| Current Path : /var/www/html/mtdc/backend/models/networking/ |
| Current File : /var/www/html/mtdc/backend/models/networking/NetworkingExperts.php.20210712 |
<?php
namespace backend\models\networking;
use Yii;
use yii\behaviors\TimestampBehavior;
use yii\behaviors\BlameableBehavior;
use yii\db\Expression;
use yii\db\ActiveRecord;
use asinfotrack\yii2\audittrail\behaviors\AuditTrailBehavior;
/**
* This is the model class for table "networking_experts".
*
* @property int $id
* @property string $name
* @property string $designation
* @property string $department
* @property int $company_id
* @property string $img_url
* @property string $user_access
* @property int $created_by
* @property string $created_at
* @property int $updated_by
* @property string $updated_at
*/
class NetworkingExperts extends \yii\db\ActiveRecord {
/**
* {@inheritdoc}
*/
public static function tableName() {
return 'networking_experts';
}
public function behaviors() {
return [
'audittrail' => [
'class' => AuditTrailBehavior::className(),
// some of the optional configurations
'ignoredAttributes' => ['created_at', 'updated_at'],
'consoleUserId' => 1,
'attributeOutput' => [
'desktop_id' => function ($value) {
$model = Desktop::findOne($value);
return sprintf('%s %s', $model->manufacturer, $model->device_name);
},
'last_checked' => 'datetime',
],
],
];
}
/**
* {@inheritdoc}
*/
public function rules() {
return [
[['company_id', 'created_by', 'updated_by'], 'integer'],
[['created_at', 'updated_at', 'designation', 'summary_cv', 'status', 'gender'], 'safe'],
[['name', 'department', 'img_url', 'user_access'], 'string', 'max' => 255],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels() {
return [
'id' => Yii::t('app', 'ID'),
'name' => Yii::t('app', 'Name'),
'designation' => Yii::t('app', 'Position'),
'department' => Yii::t('app', 'Department'),
'company_id' => Yii::t('app', 'Company Name'),
'img_url' => Yii::t('app', 'Image'),
'user_access' => Yii::t('app', 'User Access'),
'created_by' => Yii::t('app', 'Created By'),
'created_at' => Yii::t('app', 'Created At'),
'updated_by' => Yii::t('app', 'Updated By'),
'updated_at' => Yii::t('app', 'Updated At'),
'summary_cv' => Yii::t('app', 'Summary CV'),
'status' => Yii::t('app', 'Status'),
'gender' => Yii::t('app', 'Gender'),
];
}
}