- Добавлены константы в логи триггера

parent b1227b82
......@@ -18,6 +18,9 @@ use common\modules\users\models\User;
*/
class TriggerLogs extends \yii\db\ActiveRecord
{
const USER_REGISTRATION = 'registration';
const USER_VISITED = 'visited';
/**
* @inheritdoc
*/
......@@ -32,11 +35,11 @@ class TriggerLogs extends \yii\db\ActiveRecord
public function rules()
{
return [
[['user_id', 'action', 'datetime'], 'required'],
[['user_id', 'action', 'datetime', 'url'], 'required'],
[['user_id', 'presence_time'], 'integer'],
[['datetime'], 'safe'],
[['action'], 'string', 'max' => 255],
[['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => Users::className(), 'targetAttribute' => ['user_id' => 'id']],
[['action', 'url'], 'string', 'max' => 255],
[['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => User::className(), 'targetAttribute' => ['user_id' => 'id']],
];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment