public function beforeValidate() { $result = $this->baseModel->validate(); if (!$result) { $this->addError('baseModel', 'Base model error data'); } $result = $this->translateModel->validate(); if (!$result) { $this->addError('translateModel', 'Translate model error data'); } return parent::beforeValidate() && $result; // TODO: Change the autogenerated stub }
public function beforeValidate() { if (!$this->controllerClass) { $this->controllerClass = 'backend\\controllers\\' . $this->getModelName() . 'Controller'; } return parent::beforeValidate(); }
/** * @inheritdoc */ public function beforeValidate() { if (is_array($this->columns)) { $this->columns = array_filter($this->columns, function ($v) { return $v !== ''; }); } if (is_array($this->types)) { $this->types = array_filter($this->types, function ($v) { return $v !== ''; }); } $this->getMigrationClassName(); return parent::beforeValidate(); }
public function beforeValidate() { $result = $this->baseModel->validate(); if (!$result) { $this->addError('baseModel', 'Base model error data'); } $this->translateModel->modelClass = $this->translateModel->modelClass ?: $this->baseModel->modelClass . "Translate"; $this->translateModel->ns = $this->translateModel->ns ?: $this->baseModel->ns; if ($this->translateModel->generateQuery) { $this->translateModel->queryNs = $this->translateModel->queryNs ?: $this->baseModel->queryNs; $this->translateModel->queryClass = $this->translateModel->queryClass ?: $this->baseModel->queryClass . "Translate"; $this->translateModel->migrationPath = $this->baseModel->migrationPath; $this->translateModel->tableBuilder->tableName = $this->translateModel->tableBuilder->tableName ?: $this->baseModel->tableBuilder->tableName . "_translate"; } $result = $this->translateModel->validate(); if (!$result) { $this->addError('translateModel', 'Translate model error data'); } return parent::beforeValidate() && $result; // TODO: Change the autogenerated stub }