Exemple #1
0
 /**
  * Get column object by its ID
  * @param mixed $id
  * @throws Exception
  * @return Ext_Grid_Column
  */
 public function getColumn($id)
 {
     if (!$this->_columns->itemExists($id)) {
         throw new Exception('Invalid column ID');
     }
     $item = $this->_columns->getItem($id);
     return $item['data'];
 }
Exemple #2
0
 /**
  * Check if action exists
  * @param string $id - action name
  * @return boolean
  */
 public function actionExists($id)
 {
     return $this->_actions->itemExists($id);
 }
Exemple #3
0
 /**
  * Check if object exists
  * @param string $name
  * @return boolean
  */
 public function objectExists($name)
 {
     return $this->_tree->itemExists($name);
 }
Exemple #4
0
 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));
 }