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'))); }
function _init() { self::$relationships = array('media' => ORM::has_one('\\Model\\Media')); self::$fields = array('id' => ORM::field('auto[11]'), 'mime_id' => ORM::field('numeric', array(), 'INT'), 'name' => ORM::field('char[3,155]', array('required', 'max_length[155]')), 'path' => ORM::field('char[3,255]', array('required', 'max_length[255]')), 'modified' => ORM::field('datetime'), 'created' => ORM::field('datetime')); $this->ts_fields = array('modified', '[created]'); }
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]'); }