protected function _init() { parent::_init(); $this->_fields += array('invites' => new Sprig_Field_HasMany(array('model' => 'Invite', 'column' => 'inviter'))); // Fix fields $this->_fields['username'] = new Sprig_Field_Username(array('empty' => FALSE, 'unique' => TRUE)); $email = $this->_fields['email']; $email->column = 'e-mail'; $email->max_length = 255; }
protected function _init() { parent::_init(); // Overrule the names of the Roles and User_Token model to the Site_... version $this->_fields = array_merge($this->_fields, array('tokens' => new Sprig_Field_HasMany(array('model' => 'Site_User_Token', 'editable' => FALSE)), 'roles' => new Sprig_Field_ManyToMany(array('model' => 'Site_Role', 'through' => 'site_roles_users')))); }