"length[1,32]", "full_name" => "length[0,255]", "email" => "valid_email|length[1,255]", "password" => "length[1,40]", "url" => "valid_url", "locale" => "length[2,10]"); public function __set($column, $value) { switch ($column) { case "hashed_password": $column = "password"; break; case "password": $value = user::hash_password($value); break; } parent::__set($column, $value); } /** * @see ORM::delete() */ public function delete($id=null) { $old = clone $this; module::event("user_before_delete", $this); parent::delete($id); module::event("user_deleted", $old); } public function save() { if (!$this->loaded) { $created = 1; } parent::save(); if (isset($created)) { module::event("user_created", $this); } else { module::event("user_updated", $this->original(), $this); } return $this; } }