protected function _onPopulateWithInstance($instance = null)
 {
     parent::_onPopulateWithInstance($instance);
     if ($this->hasInstance()) {
         $this->getElement('url')->getValidator('Centurion_Form_Model_Validator_AlreadyTaken')->mergeParams(array('!id' => $this->getInstance()->pk, 'language_id' => $this->getInstance()->language_id));
     }
 }
Exemple #2
0
 /**
  * Event when a form is populated with an instance.
  *
  * @return void
  */
 public function _onPopulateWithInstance()
 {
     parent::_onPopulateWithInstance();
     if ($this->hasInstance()) {
         if ($this->getElement('username')) {
             $this->getElement('username')->getValidator('Centurion_Form_Model_Validator_AlreadyTaken')->setParams(array('!id' => $this->getInstance()->id));
         }
         if ($this->getElement('email_again')) {
             $this->getElement('email_again')->setValue($this->getElement('email')->getValue());
         }
         $this->getElement('email')->getValidator('Centurion_Form_Model_Validator_AlreadyTaken')->setParams(array('!id' => $this->getInstance()->id));
         if ($this->getElement('password')) {
             $this->getElement('password')->setValue(null)->setRequired(false);
             $this->getElement('password_again')->setRequired(false);
         }
     }
 }