Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.55 KB | None | 0 0
  1. <?php
  2.  
  3. class User
  4. {
  5.    
  6.     public $username = Property::create()
  7.       ->setType('string')
  8.       ->setMaxLength(20)
  9.       ->setMinLength(4)
  10.       ->setRegularExpression('/[A-Za-z0-9.-]+/')
  11.       ->setFunctionSet(function($val){
  12.         // check if given username already exists
  13.       })
  14.     ;
  15.    
  16.     public $password = Property::create()
  17.       ->setType('string')
  18.       ->setMinLength(8)
  19.       ->setMaxLength(30)
  20.       ->setFunctionSet(function($val){
  21.         return sha1($val);
  22.       })
  23.     ;
  24.    
  25.     public $lastActivity = Property::create()
  26.       ->setType('datetime')
  27.       ->setValue(time())
  28.     ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement