Your IP : 216.73.216.79


Current Path : /var/www/html/learn/backend/models/frontendcontentassign/
Upload File :
Current File : /var/www/html/learn/backend/models/frontendcontentassign/FrontendContentAssign.php

<?php

namespace backend\models\frontendcontentassign;

use Yii;

use backend\models\frontendpage\FrontendPage;
use backend\models\frontendcontent\FrontendContent;
use backend\models\frontendcontentcategory\FrontendContentCategory;

/**
 * This is the model class for table "frontend_content_assign".
 *
 * @property integer $assign_id
 * @property integer $content_id
 * @property integer $page_id
 * @property integer $content_order
 */
class FrontendContentAssign extends \yii\db\ActiveRecord
{   
    public $type, $theme_id;
    
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'frontend_content_assign';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['category_id', 'page_id', 'content_order'], 'integer'],
            [['content_id'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
			'category_id' => 'Category',
            'assign_id' => 'Assign ID',
            'content_id' => 'Content Name',
            'page_id' => 'Page Name',
            'content_order' => 'Content Order',
        ];
    }
	
	public function getCategory(){
		return $this->hasOne(FrontendContentCategory::className(),['category_id'=>'category_id']);
	}
	
	public function getPage(){
		return $this->hasOne(FrontendPage::className(),['page_id'=>'page_id']);
	}
	
	public function getContent(){
		return $this->hasOne(FrontendContent::className(),['content_id'=>'content_id']);
	}
}