Example #1
0
 public function removeFromSets()
 {
     $isi = new Dase_DBO_ItemsetItem($this->db);
     $isi->item_id = $this->id;
     foreach ($isi->findAll(1) as $doomed) {
         $doomed->delete();
     }
 }
Example #2
0
 public function postToSet($r)
 {
     $set = new Dase_DBO_Itemset($this->db);
     if (!$set->load($r->get('set_id'))) {
         $r->renderError(404);
     }
     foreach ($r->get('item', true) as $item_id) {
         $isi = new Dase_DBO_ItemsetItem($this->db);
         $isi->item_id = $item_id;
         $isi->itemset_id = $set->id;
         $isi->created = date(DATE_ATOM);
         $isi->insert();
     }
     $r->renderRedirect('set/' . $set->name);
 }
Example #3
0
 public function postToSets($r)
 {
     $item = new Dase_DBO_Item($this->db);
     if (!$item->load($r->get('id'))) {
         $r->renderError(404);
     }
     $isi = new Dase_DBO_ItemsetItem($this->db);
     $isi->item_id = $item->id;
     $isi->itemset_id = $r->get('set_id');
     if (!$isi->findOne()) {
         $isi->created = date(DATE_ATOM);
         $isi->insert();
     }
     $r->renderRedirect('item/' . $item->id);
 }
Example #4
0
 public function postToSet($r)
 {
     $set = new Dase_DBO_Itemset($this->db);
     if ($set->load($r->get('name'))) {
         $is_item = new Dase_DBO_ItemsetItem($this->db);
         $is_item->itemset_id = $set->id;
         $is_item->item_id = $r->get('item_id');
         $is_item->created = date(DATE_ATOM);
         $is_item->insert();
     }
     $r->renderRedirect('set/' . $set->name);
 }