/** * Remove Action * @param string $id * @return boolean */ public function removeAction($id) { if (!$this->actionExists($id)) { return false; } return $this->_actions->removeItem($id); }
/** * Remove object from project * @param string $name * @return boolean - success flag */ public function removeObject($name) { $eventManager = $this->getEventManager(); $methodsManager = $this->getMethodManager(); $eventManager->removeObjectEvents($name); $methodsManager->removeObjectMethods($name); $childs = $this->_tree->getChildsR($name); if (!empty($childs)) { foreach ($childs as $k => $id) { $eventManager->removeObjectEvents($id); $methodsManager->removeObjectMethods($id); $this->_tree->removeItem($id); } } return $this->_tree->removeItem($name); }
/** * Remove column by id * @param string $id */ public function removeColumn($id) { $this->_columns->removeItem($id); }
/** * Remove Query part * @param string $partId * @return boolean */ public function removePart($partId) { $this->_tree->removeItem($partId); return true; }
public function testRemoveItem() { $tree = new Tree(); $item = new stdClass(); $item->id = 1; $tree->addItem($item->id, 0, $item); $item2 = new stdClass(); $item2->id = 2; $tree->addItem($item2->id, 1, $item2); $tree->removeItem(2); $this->assertEquals($tree->getItemsCount(), 1); $this->assertFalse($tree->itemExists(2)); $this->assertFalse($tree->hasChilds(1)); }