コード例 #1
0
ファイル: TagItem.php プロジェクト: rakeshraushan/dase
 function getTag()
 {
     $tag = new Dase_DBO_Tag($this->db);
     if ($tag->load($this->tag_id)) {
         return $tag;
     } else {
         return false;
     }
 }
コード例 #2
0
ファイル: Tag.php プロジェクト: rakeshraushan/dase
 protected function setup($r)
 {
     //Locates requested tag.  Method still needs to authorize.
     $tag = new Dase_DBO_Tag($this->db);
     if ($r->has('tag_ascii_id') && $r->has('eid')) {
         $tag->ascii_id = $r->get('tag_ascii_id');
         $tag->eid = $r->get('eid');
         $found = $tag->findOne();
     } elseif ($r->has('tag_id')) {
         $found = $tag->load($r->get('tag_id'));
     }
     if (isset($found) && $found && $found->id) {
         $this->tag = $tag;
     } else {
         $r->renderError(404, 'no such tag');
     }
 }
コード例 #3
0
ファイル: User.php プロジェクト: rakeshraushan/dase
 public function deleteTagItem($r)
 {
     $u = $this->user;
     $u->expireDataCache($r->getCache());
     $tag_item = new Dase_DBO_TagItem($this->db);
     $tag_item->load($r->get('tag_item_id'));
     $tag = new Dase_DBO_Tag($this->db);
     $tag->load($tag_item->tag_id);
     //todo: make this tag->eid == $u->eid
     if ($tag->dase_user_id == $u->id) {
         $tag_item->delete();
         $tag->updateItemCount();
         $r->renderResponse("tag item " . $r->get('tag_item_id') . " deleted!", false);
     } else {
         $r->renderError(401, 'user does not own tag');
     }
 }
コード例 #4
0
ファイル: TagCategory.php プロジェクト: rakeshraushan/dase
 public function getTag()
 {
     $tag = new Dase_DBO_Tag($this->db);
     $tag->load($this->tag_id);
     return $tag;
 }