/var/www/vhosts/nabawater/backend/modules/translation/models
Edit: /var/www/vhosts/nabawater/backend/modules/translation/models/SourceMessage.php (1165B)
'Mobile',
'frontend'=>'Frontend',
'backend'=>'Backend',
'common'=> 'Common'
];
}
/**
* @param $attribute
* @param $params
* @param $validator
*/
public function validateMessage($attribute, $params, $validator)
{
$model = self::find()->where(['message' => $this->message, 'category' => $this->category]);
if( !$this->isNewRecord ){
$model->andWhere(['not in', 'id', [$this->getPrimaryKey()]]);
}
if ( $model->one() !== null ){
$this->addError($attribute, 'Message must be unique. ');
}
}
}