public function deleteTax($id) { if (!is_numeric($id)) { throw new Exceptions\InvalidArgumentException("Argument id has to be type of numeric, '{$id}' given"); } try { $db = $this->taxDao->find($id); if ($db !== null) { $this->invalidateEntityCache($db); $this->taxDao->delete($db); $this->onDelete($db); } } catch (\Exception $ex) { $this->logError($ex->getMessage()); throw new Exceptions\DataErrorException($ex->getMessage(), $ex->getCode(), $ex->getPrevious()); } }
public function deleteEntry($id) { try { $mbDb = $this->mailboxDao->find($id); if ($mbDb !== null) { if ($mbDb->getType() == MailBoxEntryType::DELETED) { $this->invalidateEntityCache($mbDb); $this->mailboxDao->delete($mbDb); } else { $this->markAsDeleted($id); } $this->onDelete($mbDb); } } catch (\Exception $ex) { $this->logError($ex->getMessage()); throw new Exceptions\DataErrorException($ex->getMessage(), $ex->getCode(), $ex->getPrevious()); } }