/** * Delete layout * * @return boolean */ public function delete() { $this->events()->trigger(__CLASS__, 'before.delete', $this); $id = $this->getId(); if (!empty($id)) { try { parent::delete(array('id' => $id)); } catch (\Exception $e) { throw new \Gc\Exception($e->getMessage(), $e->getCode(), $e); } if (file_exists($this->getFilePath())) { unlink($this->getFilePath()); } $this->events()->trigger(__CLASS__, 'after.delete', $this); unset($this); return true; } $this->events()->trigger(__CLASS__, 'after.delete.failed', $this); return false; }
/** * Delete event * * @return boolean */ public function delete() { $id = $this->getId(); if (!empty($id)) { try { parent::delete(array('id' => $id)); } catch (\Exception $e) { throw new \Gc\Exception($e->getMessage(), $e->getCode(), $e); } unset($this); return true; } return false; }
/** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. * * @return void */ protected function tearDown() { $this->object->delete(); unset($this->object); }
/** * Delete tab * * @return boolean */ public function delete() { $this->events()->trigger(__CLASS__, 'before.delete', $this); $tabId = $this->getId(); if (!empty($tabId)) { try { $propertiesCollection = new Property\Collection(); $propertiesCollection->load(null, $tabId); $propertiesCollection->delete(); parent::delete(array('id' => $tabId)); } catch (\Exception $e) { throw new \Gc\Exception($e->getMessage(), $e->getCode(), $e); } $this->events()->trigger(__CLASS__, 'after.delete', $this); unset($this); return true; } $this->events()->trigger(__CLASS__, 'after.delete.failed', $this); return false; }
/** * Delete document * * @return boolean */ public function delete() { $this->events()->trigger(__CLASS__, 'before.delete', $this); $documentId = $this->getId(); if (!empty($documentId)) { try { $propertiesTable = new TableGateway('property_value', $this->getAdapter()); $propertiesTable->delete(array('document_id' => $this->getId())); parent::delete(array('id' => $documentId)); } catch (\Exception $e) { throw new \Gc\Exception($e->getMessage(), $e->getCode(), $e); } $this->events()->trigger(__CLASS__, 'after.delete', $this); unset($this); return true; } $this->events()->trigger(__CLASS__, 'after.delete.failed', $this); return false; }
/** * Delete Role * * @return boolean */ public function delete() { $this->events()->trigger(__CLASS__, 'before.delete', $this); $id = $this->getId(); if (!empty($id)) { parent::delete(array('id' => $id)); $this->events()->trigger(__CLASS__, 'after.delete', $this); unset($this); return true; } $this->events()->trigger(__CLASS__, 'after.delete.failed', $this); return false; }
/** * Delete property * * @return boolean */ public function delete() { $this->events()->trigger(__CLASS__, 'before.delete', $this); $id = $this->getId(); if (!empty($id)) { try { parent::delete(array('id' => (int) $id)); $table = new TableGateway('property_value', $this->getAdapter()); $table->delete(array('property_id' => (int) $id)); } catch (\Exception $e) { throw new \Gc\Exception($e->getMessage()); } $this->events()->trigger(__CLASS__, 'after.delete', $this); return true; } $this->events()->trigger(__CLASS__, 'after.delete.failed', $this); return false; }
/** * Delete document type model * * @return boolean */ public function delete() { $this->events()->trigger(__CLASS__, 'before.delete', $this); $documentTypeId = $this->getId(); if (!empty($documentTypeId)) { $tabCollection = new Tab\Collection(); $tabCollection->load($documentTypeId); $tabCollection->delete(); $table = new TableGateway('document_type_view', $this->getAdapter()); $table->delete(array('document_type_id' => (int) $documentTypeId)); parent::delete(array('id' => $documentTypeId)); $this->events()->trigger(__CLASS__, 'after.delete', $this); unset($this); return true; } $this->events()->trigger(__CLASS__, 'after.delete.failed', $this); return false; }