Your IP : 216.73.216.79


Current Path : /var/www/html/maiwp.bak/backend/modules/orgchart/models/
Upload File :
Current File : /var/www/html/maiwp.bak/backend/modules/orgchart/models/OrganizationChart.php

<?php

namespace backend\modules\orgchart\models;

use Yii;

/**
 * This is the model class for table "organization_chart".
 *
 * @property int $id
 * @property int|null $user_id
 * @property int|null $parent_id
 * @property string|null $dept
 * @property int|null $sorting
 * @property string|null $created_at
 * @property int|null $created_by
 * @property string|null $updated_at
 * @property int|null $updated_by
 */
class OrganizationChart extends \yii\db\ActiveRecord {

    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return 'organization_chart';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['user_id', 'parent_id', 'sorting', 'created_by', 'updated_by'], 'integer'],
            [['created_at', 'updated_at', 'higher', 'offset'], 'safe'],
            [['dept'], 'string', 'max' => 255],
            [['user_id', 'visible', 'level'], 'required'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'user_id' => 'Staff Name',
            'parent_id' => 'Parent ID',
            'dept' => 'Dept',
            'sorting' => 'Sorting',
            'created_at' => 'Created At',
            'created_by' => 'Created By',
            'updated_at' => 'Updated At',
            'updated_by' => 'Updated By',
            'higher' => 'Higher Level',
            'offset' => 'Offset',
            'level' => 'Level',
            'visible' => 'Visible'
        ];
    }

    public function getStaff() {
        return $this->hasOne(\backend\modules\contentDirectory\models\ContentDirectory::className(), ['employee_id' => 'user_id']);
    }

}