Author: Kohana Team
Inheritance: extends ORM
コード例 #1
0
ファイル: Token.php プロジェクト: Konro1/pms
 public function generate_unique_token()
 {
     do {
         $this->token = Model_Auth_User_Token::generate_token();
         $collection = Jam::all($this->meta()->model())->where_key($this->token)->limit(1);
     } while (Jam::all($this)->where('token', '=', $this->token)->limit(1)->count_all() > 0);
     return $this;
 }
コード例 #2
0
ファイル: token.php プロジェクト: azuya/Wi3
 protected function _init()
 {
     parent::_init();
     // Overrule the names of the User_Roles model to the Site_... version
     $this->_fields = array_merge($this->_fields, array('user' => new Sprig_Field_BelongsTo(array('model' => 'Site_User', 'column' => 'site_user_id'))));
 }
コード例 #3
0
ファイル: Token.php プロジェクト: Konro1/pms
 public static function initialize(Jam_Meta $meta)
 {
     $meta->db(Kohana::TESTING);
     parent::initialize($meta);
     $meta->associations(array('user' => Jam::association('belongsto', array('foreign_model' => 'test_user', 'foreign_key' => 'test_user_id'))));
 }