classes/Kohana/Element.php
public function get_item($id)
	{
		// Element empty!
		if (count($this->_items) === 0)
			return FALSE;

		if (array_key_exists($id, $this->_items))
		{ // By ID
			return $this->_items[$id];
		} else
		{ // By route
			$path = $this->get_tree_index(Route::get($id));

			if($path != false)
			{
				$levels = count($path);

				$item = $this->_items[$path[0]];

				if($levels > 1)
				{
					for($i=1; $i<$levels; $i++)
					{
						$item = $item->siblings[$path[$i]];
					}
				}
				return $item;
			}
		}
		return FALSE;
	}
public function get_item($id)
	{
		// Element empty!
		if (count($this->_items) === 0)
			return FALSE;

		if (array_key_exists($id, $this->_items))
		{ // By ID
			return $this->_items[$id];
		} else
		{ // By route
			$path = $this->get_tree_index(Route::get($id));

			if($path != false)
			{
				$levels = count($path);

				$item = $this->_items[$path[0]];

				if($levels > 1)
				{
					for($i=1; $i<$levels; $i++)
					{
						$item = $item->siblings[$path[$i]];
					}
				}
				return $item;
			}
		}
		return FALSE;
	}
public function get_item ( $ id ) { // Element empty! if ( count ( $ this -> _items ) === 0 ) return FALSE ; if ( array_key_exists ( $ id , $ this -> _items ) ) { // By ID return $ this -> _items [ $ id ] ; } else { // By route $ path = $ this -> get_tree_index ( Route :: get ( $ id ) ) ; if ( $ path != false ) { $ levels = count ( $ path ) ; $ item = $ this -> _items [ $ path [ 0 ] ] ; if ( $ levels > 1 ) { for ( $ i = 1 ; $ i < $ levels ; $ i ++ ) { $ item = $ item -> siblings [ $ path [ $ i ] ] ; } } return $ item ; } } return FALSE ; }
Get an instance of Element_Item based on its ID

@param int|string $id Item ID or route name
@return Element_Item
Get an instance of Element_Item based on its ID