/** * @see ItemListenerInterface::is_type_or_category() * @param integer $category_id * @param integer $type_id * @param integer $item_id * @return bool */ public static function is_type_or_category($category_id, $type_id, $item_id) { if (is_numeric($type_id)) { $equpiment_id = EquipmentIsItem_Access::get_entry_by_item_id($item_id); $equipment = new Equipment($equpiment_id); if ($equipment->get_type_id() == $type_id) { return true; } else { return false; } } elseif (is_numeric($category_id)) { $equipment_id = EquipmentIsItem_Access::get_entry_by_item_id($item_id); $equipment = new Equipment($equipment_id); $equipment_type = new SampleTtype($equipment->get_type_id()); if ($equipment_type->get_cat_id() == $category_id) { return true; } else { return false; } } else { return false; } }
/** * @throws EquipmentIDMissingException */ public static function detail() { if ($_GET['id']) { $equipment = new Equipment($_GET['id']); self::type_detail($equipment->get_type_id(), $equipment->get_owner_id()); } else { throw new EquipmentIDMissingException(); } }