View file upload/src/addons/XenCentral/Feedback/Entity/FeedbackComment.php

File size: 1.58Kb
<?php
/**
 * @package XenCentral Feedback System
 * @author DNF Technology
 * @copyright Drnoyan & Nalyan LDA, Portugal, EU
 * @license http://dnf.technology/terms/
 * @link http://customers.dnf.technology
 * @version 2.0.0 Beta 10
 * @revision 12
 */

namespace XenCentral\Feedback\Entity;

use XF\Mvc\Entity\Entity;
use XF\Mvc\Entity\Structure;


class FeedbackComment extends Entity
{
    public static function getStructure(Structure $structure)
    {
        $structure->table = 'xf_xc_feedback_comment';
        $structure->shortName = 'XenCentral\Feedback:FeedbackComment';
        $structure->primaryKey = 'comment_id';
        $structure->contentType = 'feedback_comment';
        $structure->columns = [
            'comment_id' => ['type' => self::UINT, 'autoIncrement' => true, 'nullable' => true],
            'fb_id' => ['type' => self::UINT, 'default'=> 0,
                'required' => 'true'
            ],
            'user_id' => ['type' => self::UINT, 'default'=> 0,
                'required' => 'true'
            ],
            'message' => ['type' => self::STR,
                'required' => 'please_enter_valid_message'
            ],
            'dateline' => ['type' => self::UINT, 'default' => \XF::$time],
            'ip_id' => ['type' => self::UINT, 'default' => 0, 'maxLength' => 10],
            'importid' => ['type' => self::STR, 'default' => 0]];
        $structure->behaviors = [
            'XenCentral\Feedback:Comment' => [] // will pick up content type automatically
        ];

	    $structure->options = [
		    'saveip' => true
	    ];

        return $structure;
    }

}