本文整理汇总了PHP中yii\db\ActiveRecord::afterValidate方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveRecord::afterValidate方法的具体用法?PHP ActiveRecord::afterValidate怎么用?PHP ActiveRecord::afterValidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\db\ActiveRecord
的用法示例。
在下文中一共展示了ActiveRecord::afterValidate方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afterValidate
public function afterValidate()
{
if ($this->getScenario() == 'signup') {
parent::afterValidate();
$this->setPassword($this->password);
}
}
示例2: afterValidate
public function afterValidate()
{
$this->size = $this->file->size;
$this->name = $this->file->name;
$this->file->saveAs(\Yii::getAlias(self::FILE_DIR) . '/' . $this->name);
return parent::afterValidate();
}
示例3: afterValidate
public function afterValidate()
{
if (parent::afterValidate()) {
return true;
}
return false;
}
示例4: afterValidate
/**
* @inheritdoc
*/
public function afterValidate()
{
parent::afterValidate();
if (is_callable($this->afterValidate)) {
call_user_func_array($this->afterValidate, [$this, 'afterValidate']);
}
}
示例5: afterValidate
public function afterValidate()
{
if ($this->isNewRecord) {
$this->created_at = time();
$this->created_by = \Yii::$app->getUser()->getId();
} else {
$this->updated_at = time();
$this->updated_by = \Yii::$app->getUser()->getId();
}
return parent::afterValidate();
}
示例6: afterValidate
public function afterValidate()
{
parent::afterValidate();
if (!$this->hasErrors()) {
if ($this->userValidate) {
$this->finalValidate();
}
}
if ($this->hasErrors()) {
LuLu::setErrorMessage($this->getFirstErrors());
LuLu::info($this->errors, 'validate error:' . self::className());
}
}
示例7: afterValidate
public function afterValidate()
{
parent::afterValidate();
}
示例8: afterValidate
public function afterValidate()
{
parent::afterValidate();
if ($this->hasErrors())
{
LuLu::info($this->errors, self::className());
}
}
示例9: afterValidate
public function afterValidate()
{
$this->_init();
if ($this->api) {
return parent::afterValidate();
}
/*
if ($this->fileName && !is_file($this->tmpDir . '/' . $this->fileName)) {
Yii::$app->getSession()->setFlash('error', 'There was an error uploading the file.');
$this->addError('fileName');
}
*/
if (Yii::$app->request->isPost && !$this->fileName) {
$this->file = UploadedFile::getInstance($this, 'file');
$this->fileName = $this->tmpFileName . '.' . $this->file->extension;
$this->file->saveAs($this->tmpDir . '/' . $this->fileName);
}
return parent::afterValidate();
}
示例10: afterValidate
public function afterValidate()
{
parent::afterValidate();
if ($this->hasErrors()) {
LuLu::setErrorMessage($this->getFirstErrors());
LuLu::info($this->errors, self::className());
}
}
示例11: afterValidate
public function afterValidate()
{
parent::afterValidate();
if ($this->hasErrors()) {
//var_dump($this->errors);
}
}