protected function delete() { // ladowanie klasy $item = new ClassEquipmentType(ClassTools::getValue('id_equipment_type')); // sprawdza czy klasa zostala poprawnie zaladowana if ($item->load_class) { // usuwanie if ($item->delete()) { // komunikat $this->alerts['success'] = "Poprawnie usunięto typ wyposażenia: <b>{$item->name}</b>"; return; } else { // bledy w przypadku problemow z usunieciem $this->alerts['danger'] = $item->errors; return; } } $this->alerts['danger'] = 'Typ wyposażenia nie istnieje'; $_POST = array(); return; }