Last active
August 29, 2015 14:27
-
-
Save 42milez/dfde9eca7a7000eea437 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Aug. 21, 2015 - Akihiro TAKASE | |
* | |
* 本ファイルには User テーブルに対応するモデルの定義が含まれます。 | |
* | |
*/ | |
class Model_User extends \Orm\Model { | |
// プロパティ | |
protected static $_properties = array( | |
'id', | |
'name', | |
'email', | |
'hashed_password', | |
'salt', | |
're', | |
); | |
// バリデーションルール | |
public static function validate($factory) { | |
$val = Validation::forge($factory); | |
$val->add_field('name', 'Name', 'required|max_length[50]'); | |
$val->add_field('email', 'Email', 'required|max_length[255]|valid_email'); | |
$val->add_field('password', 'Password', 'required|max_length[60]'); | |
return $val; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment