Your IP : 216.73.216.124


Current Path : /var/www/html/ebook/backend/models/
Upload File :
Current File : /var/www/html/ebook/backend/models/AuditTrailEntry.php

<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "audit_trail_entry".
 *
 * @property int $id
 * @property string $model_type
 * @property int $happened_at
 * @property string $foreign_pk
 * @property int $user_id
 * @property string $type
 * @property string $data
 */
class AuditTrailEntry extends \common\models\Dermaga
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'audit_trail_entry';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['model_type', 'happened_at', 'foreign_pk', 'type'], 'required'],
            [['happened_at', 'user_id'], 'integer'],
            [['data'], 'string'],
            [['model_type', 'foreign_pk', 'type'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'model_type' => Yii::t('app', 'Model'),
            'happened_at' => Yii::t('app', 'Masa'),
            'foreign_pk' => Yii::t('app', 'Foreign Pk'),
            'user_id' => Yii::t('app', 'Pengguna'),
            'type' => Yii::t('app', 'Type'),
            'data' => Yii::t('app', 'Data'),
        ];
    }

    public function getUser(){
        return $this->hasOne(\backend\models\User::className(), ['id' => 'user_id']);
    }
}