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); } }
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(); } } }