コード例 #1
0
ファイル: Manage.php プロジェクト: rakeshraushan/dase
 public function deleteItemTypeAttribute($r)
 {
     $type = Dase_DBO_ItemType::get($this->db, $this->collection->ascii_id, $r->get('type_ascii_id'));
     $att = Dase_DBO_Attribute::get($this->db, $this->collection->ascii_id, $r->get('att_ascii_id'));
     $ita = new Dase_DBO_AttributeItemType($this->db);
     $ita->attribute_id = $att->id;
     $ita->item_type_id = $type->id;
     if ($ita->findOne()) {
         $ita->delete();
         $r->renderOk('done');
     } else {
         $r->renderError(400);
     }
 }
コード例 #2
0
ファイル: Attribute.php プロジェクト: rakeshraushan/dase
 function addItemType($item_type_ascii)
 {
     $c = $this->getCollection();
     $type = Dase_DBO_ItemType::get($this->db, $c->ascii_id, $item_type_ascii);
     if ($type) {
         $ita = new Dase_DBO_AttributeItemType($this->db);
         $ita->attribute_id = $this->id;
         $ita->item_type_id = $type->id;
         if (!$ita->findOne()) {
             $ita->insert();
         }
     }
 }