Example #1
0
File: users.php Project: rhrn/apirn
 public function token($token)
 {
     $id = Model::factory('v1_tokens')->user($token);
     if ($id) {
         self::$user_id = MDB::objectId($id);
         return $this->get();
     }
 }
Example #2
0
File: test.php Project: rhrn/apirn
 public function action_find()
 {
     MDB::$config = Kohana::$config->load('database')->mongo;
     $id = '4f645e4f6e3d1c284e000001';
     $id = MDB::objectId($id);
     MDB::collection('users');
     $find = MDB::find($id);
     d::v(iterator_to_array($find));
 }
Example #3
0
File: tags.php Project: rhrn/apirn
 public function remove($user, $id)
 {
     $remove = MDB::objectId($id);
     $remove['user_id'] = MDB::stringId($user);
     $x = $this->collection->remove($remove, array('safe' => true));
     if ($x['n']) {
         return $id;
     }
 }