Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class User
- {
- public $username = Property::create()
- ->setType('string')
- ->setMaxLength(20)
- ->setMinLength(4)
- ->setRegularExpression('/[A-Za-z0-9.-]+/')
- ->setFunctionSet(function($val){
- // check if given username already exists
- })
- ;
- public $password = Property::create()
- ->setType('string')
- ->setMinLength(8)
- ->setMaxLength(30)
- ->setFunctionSet(function($val){
- return sha1($val);
- })
- ;
- public $lastActivity = Property::create()
- ->setType('datetime')
- ->setValue(time())
- ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement