Exemplo n.º 1
0
 protected function beforeObjectSave()
 {
     parent::beforeObjectSave();
     $new_pass = $this->form->getValue('new_pass');
     if ($new_pass) {
         if (!isset($this->objects[0])) {
             return $this->terminate();
         }
         $object = $this->objects[0];
         $object->pass = md5($new_pass);
     }
 }
Exemplo n.º 2
0
 protected function beforeObjectSave($object)
 {
     parent::beforeObjectSave();
     if ($this->action != 'edit') {
         return;
     }
     $new_status = $this->form->getValue('new_status');
     if ($new_status) {
         $new_status_comment = $this->form->getValue('new_status_comment');
         $object->setStatus($new_status, $new_status_comment);
     }
 }