Ejemplo n.º 1
0
 function _init()
 {
     // FIELD DEFINITION
     self::$fields = array('id' => ORM::field('auto[11]'), 'first_name' => ORM::field('char[255]', array('required')), 'last_name' => ORM::field('char[255]', array('required')), 'username' => ORM::field('email', array('required', 'is_unique[users.username]')), 'password' => ORM::field('string', array('required')), 'role' => ORM::field('char[255]'), 'status' => ORM::field('char[255]'), 'created_at' => ORM::field('datetime'), 'updated_at' => ORM::field('datetime'));
     //
     // SETUP DATETIME ASSOCIATION
     $this->ts_fields = array('updated_at', '[created_at]');
 }
Ejemplo n.º 2
0
 function _init()
 {
     // Define relationships
     self::$relationships = array('wife' => ORM::has_one('\\Model\\Wife', array('select:id,name')), 'kid' => ORM::has_many('\\Model\\Kid', array('select:id,name')), 'job' => ORM::has_many('\\Model\\Job\\User => \\Model\\Job', array('select:id,name')), 'role' => ORM::has_many('\\Model\\Role\\User => \\Model\\Role', array('select:id,name')));
     // Define fields definition
     self::$fields = array('id' => ORM::field('auto[3]'), 'name' => ORM::field('char[40]'), 'email' => ORM::field('email[40]'), 'username' => ORM::field('char[10]', array('required', 'callback_username_check')));
 }
Ejemplo n.º 3
0
 function _init()
 {
     self::$relationships = array('blog' => ORM::has_many('\\Model\\Blog'), 'passphrase' => ORM::has_one('\\Model\\User_passphrase'));
     self::$fields = array('id' => ORM::field('auto[10]'), 'email' => ORM::field('char[64]'), 'modified' => ORM::field('datetime'), 'created' => ORM::field('datetime'));
     $this->ts_fields = array('modified', '[created]');
 }