| Current Path : /var/www/html/dosm/backend/models/ |
| Current File : /var/www/html/dosm/backend/models/Feedback.php |
<?php
namespace backend\models;
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 "feedback".
*
*/
class Feedback extends \yii\db\ActiveRecord {
/**
* @inheritdoc
*/
public static function tableName() {
return 'feedback';
}
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 [
[['feedback_type', 'name', 'emel', 'details'], 'required'],
[['ticket_no', 'submit_at'], 'safe'],
];
}
public function attributeLabels() {
return [
'feedback_type' => 'Type',
'name' => 'Name',
'emel' => 'Email Address',
'details' => 'Feedback',
'ticket_no' => 'Ticket Number',
'submit_at' => 'Date & Time Submit'
];
}
}