public function validateEmail($checkExisting = true) { $vrf = Util\Validate::validate('email', $this->getModel()->getEmail(), $this->emailValidator); if ($vrf->getResult() == \Rebond\Core\ResultType::ERROR) { return $vrf; } if ($checkExisting && \Rebond\Core\User\Data::emailExists($this->getModel()->getEmail(), $this->getModel()->getId()) > 0) { $vrf->setResult(\Rebond\Core\ResultType::ERROR); $vrf->setMessage(Util\Lang::lang('emailExist')); } return $vrf; }