コード例 #1
0
 /**
  * Test if validation passes before update
  *
  * @author ZZK
  * @link   http://verecom.com
  *
  * @return bool
  */
 public function validForUpdate()
 {
     if (empty($this->data['password']) and empty($this->data['password_confirmation'])) {
         unset($this->rules['password']);
         unset($this->data['password']);
     }
     return parent::passes();
 }
コード例 #2
0
 /**
  * Test if validation passes before update
  *
  * @author ZZK
  * @link   http://verecom.com
  *
  * @return bool
  */
 public function validForUpdate()
 {
     $this->rules['name'] .= ',name,' . $this->data['id'];
     return parent::passes();
 }