Gc\Tab\Model::delete PHP Méthode

delete() public méthode

Delete tab
public delete ( ) : boolean
Résultat 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;
    }

Usage Example

Exemple #1
0
 /**
  * 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->tab->delete();
     $this->documentType->delete();
     $this->user->delete();
     $this->layout->delete();
     $this->view->delete();
     unset($this->tab);
     unset($this->documentType);
     unset($this->user);
     unset($this->layout);
     unset($this->view);
     unset($this->object);
 }
All Usage Examples Of Gc\Tab\Model::delete