Your IP : 216.73.216.79


Current Path : /var/www/html/jppmintranetv2/backend/modules/contentDirectory/models/
Upload File :
Current File : /var/www/html/jppmintranetv2/backend/modules/contentDirectory/models/ContentDirectory.php

<?php

namespace backend\modules\contentDirectory\models;

use Yii;
use backend\modules\contentDirectory\Module as M;

/**
 * This is the model class for table "content_directory".
 *
 * @property int $employee_no
 * @property string|null $created_at
 * @property int|null $created_by
 * @property string|null $updated_at
 * @property int|null $updated_by
 */
class ContentDirectory extends \yii\db\ActiveRecord {

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

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['employee_name', 'employee_email', 'employee_phone', 'employee_status', 'employee_job', 'employee_grade', 'employee_dept', 'employee_unit'], 'required'],
            [['created_at', 'updated_at', 'employee_dob', 'employee_fax', 'employee_figure', 'employee_unit2', 'employee_mobile'], 'safe'],
            [['created_by', 'updated_by', 'sorting'], 'integer'],
            [['employee_status',], 'string', 'max' => 6],
            //[['employee_phone'], 'match', 'pattern' => '/^(\+?6?01)[0|1|2|3|4|6|7|8|9]\-*[0-9]{7,8}$/', 'message' => M::t('app', 'NotValid')],
            [['employee_name', 'employee_dept', 'employee_image'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'employee_id' => M::t('app', 'ID'),
            'employee_name' => M::t('app', 'Name'),
            'employee_dob' => M::t('app', 'Date of Birth'),
            'employee_phone' => M::t('app', 'Telephone Number'),
            'employee_email' => M::t('app', 'Email Address'),
            'employee_dept' => M::t('app', 'Department'),
            'employee_image' => M::t('app', 'Image'),
            'employee_status' => M::t('app', 'Status'),
            'employee_job' => M::t('app', 'Position'),
            'employee_grade' => M::t('app', 'Grade'),
            'sorting' => M::t('app', 'Order'),
            'created_at' => M::t('app', 'CreatedAt'),
            'created_by' => M::t('app', 'CreatedBy'),
            'updated_at' => M::t('app', 'UpdatedAt'),
            'updated_by' => M::t('app', 'UpdatedBy'),
            'employee_fax' => 'Fax Number',
            'employee_figure' => 'Figure Status',
            'employee_unit' => 'Division',
            'employee_unit2' => 'Unit / Branch / Section',
            'employee_mobile' => 'Mobile Phone Number',
        ];
    }

    public static function getname($id) {
        $output = '';
        if (($model = self::findOne($id)) !== null)
            $output = $model->employee_name;
        return $output;
    }

}