_requireEmail = $requireEmail; return $this; } /** * @param boolean $requireNickname * @return $this */ public function setRequireNickname($requireNickname) { $this->_requireNickname = $requireNickname; return $this; } protected function _initPasswordFields() { parent::_initPasswordFields(); if ($this->_getData('password')) { $this->getElement('password')->setDescription('Leave blank to keep current password unchanged'); $this->getElement('confirmPassword')->setDescription('Leave blank to keep current password unchanged'); } return $this; } protected function _initEmailField() { parent::_initEmailField(); $this->getElement('email')->setRequired($this->_requireEmail); return $this; } protected function _initPersonalFields() { parent::_initPersonalFields(); $this->getElement('nickname')->setRequired($this->_requireNickname); $this->getElement('directPhone')->setRequired((bool) $this->_getData('directPhone')); return $this; } }