/** * @inheritDoc BaseRecord::validate() * * @param null $attributes * @param bool $clearErrors * * @return bool|null */ public function validate($attributes = null, $clearErrors = true) { // Don't allow whitespace in the username. if (preg_match('/\\s+/', $this->username)) { $this->addError('username', Craft::t('Spaces are not allowed in the username.')); } return parent::validate($attributes, false); }
function validate() { // execute the column validation parent::validate(); // custom validatio for unique messageid and recipientid combination }