| Current Path : /var/www/html/akept/backend/models/ |
| Current File : /var/www/html/akept/backend/models/ContentIndicator.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 "content_photo_gallery".
*
*/
class ContentIndicator extends \yii\db\ActiveRecord {
/**
* {@inheritdoc}
*/
public static function tableName() {
return 'indicator';
}
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 [
[['image', 'image2', 'title', 'amount', 'subtitle', 'month', 'cat', 'code'], 'safe'],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels() {
return [
'image' => Yii::t('app', 'Top Image'),
'image2' => Yii::t('app', 'Bottom Image'),
'month' => 'Month / Year Label',
'cat' => 'Category',
'code' => 'Source Code (PHP)'
];
}
}