public function getRefItems( $domain, $type = null, $listtype = null )
	{
		if( !isset( $this->_refItems[$domain] ) || !isset( $this->_listItems[$domain] ) ) {
			return array();
		}

		if( !isset( $this->_sortedRefs[$domain] ) )
		{
			$iface = 'MShop_Common_Item_List_Interface';

			foreach( $this->_listItems[$domain] as $listItem )
			{
				$refId = $listItem->getRefId();

				if( isset( $this->_refItems[$domain][$refId] ) && $listItem instanceof $iface )
				{
					$this->_refItems[$domain][$refId]->_listtype = $listItem->getType();
					$this->_refItems[$domain][$refId]->_position = $listItem->getPosition();
				}
			}

			uasort( $this->_refItems[$domain], array( $this, '_compareRefPosition' ) );

			/** @todo: This doesn't work with PHP 5.3 on Solaris -> _listtype gets screwed up if not set again the second time */
			// $this->_sortedRefs[$domain] = true;
		}

		if( $type !== null || $listtype !== null )
		{
			$list = array();
			$iface = 'MShop_Common_Item_Typeid_Interface';

			foreach( $this->_refItems[$domain] as $id => $item )
			{
				if( $item instanceof $iface
					&& ( $type === null || $type === $item->getType() )
					&& ( $listtype === null || $listtype === $item->_listtype ) )
				{
					$list[$id] = $item;
				}
			}
		}
		else
		{
			$list = $this->_refItems[$domain];
		}

		return $list;
	}
public function getRefItems( $domain, $type = null, $listtype = null )
	{
		if( !isset( $this->_refItems[$domain] ) || !isset( $this->_listItems[$domain] ) ) {
			return array();
		}

		if( !isset( $this->_sortedRefs[$domain] ) )
		{
			$iface = 'MShop_Common_Item_List_Interface';

			foreach( $this->_listItems[$domain] as $listItem )
			{
				$refId = $listItem->getRefId();

				if( isset( $this->_refItems[$domain][$refId] ) && $listItem instanceof $iface )
				{
					$this->_refItems[$domain][$refId]->_listtype = $listItem->getType();
					$this->_refItems[$domain][$refId]->_position = $listItem->getPosition();
				}
			}

			uasort( $this->_refItems[$domain], array( $this, '_compareRefPosition' ) );

			/** @todo: This doesn't work with PHP 5.3 on Solaris -> _listtype gets screwed up if not set again the second time */
			// $this->_sortedRefs[$domain] = true;
		}

		if( $type !== null || $listtype !== null )
		{
			$list = array();
			$iface = 'MShop_Common_Item_Typeid_Interface';

			foreach( $this->_refItems[$domain] as $id => $item )
			{
				if( $item instanceof $iface
					&& ( $type === null || $type === $item->getType() )
					&& ( $listtype === null || $listtype === $item->_listtype ) )
				{
					$list[$id] = $item;
				}
			}
		}
		else
		{
			$list = $this->_refItems[$domain];
		}

		return $list;
	}
public function getRefItems ( $ domain , $ type = null , $ listtype = null ) { if ( ! isset ( $ this -> _refItems [ $ domain ] ) || ! isset ( $ this -> _listItems [ $ domain ] ) ) { return array ( ) ; } if ( ! isset ( $ this -> _sortedRefs [ $ domain ] ) ) { $ iface = 'MShop_Common_Item_List_Interface' ; foreach ( $ this -> _listItems [ $ domain ] as $ listItem ) { $ refId = $ listItem -> getRefId ( ) ; if ( isset ( $ this -> _refItems [ $ domain ] [ $ refId ] ) && $ listItem instanceof $ iface ) { $ this -> _refItems [ $ domain ] [ $ refId ] -> _listtype = $ listItem -> getType ( ) ; $ this -> _refItems [ $ domain ] [ $ refId ] -> _position = $ listItem -> getPosition ( ) ; } } uasort ( $ this -> _refItems [ $ domain ] , array ( $ this , '_compareRefPosition' ) ) ; /** @todo: This doesn't work with PHP 5.3 on Solaris -> _listtype gets screwed up if not set again the second time */ // $this->_sortedRefs[$domain] = true; } if ( $ type !== null || $ listtype !== null ) { $ list = array ( ) ; $ iface = 'MShop_Common_Item_Typeid_Interface' ; foreach ( $ this -> _refItems [ $ domain ] as $ id => $ item ) { if ( $ item instanceof $ iface && ( $ type === null || $ type === $ item -> getType ( ) ) && ( $ listtype === null || $ listtype === $ item -> _listtype ) ) { $ list [ $ id ] = $ item ; } } } else { $ list = $ this -> _refItems [ $ domain ] ; } return $ list ; }
Returns the product, text, etc. items filtered by domain and optionally by type and list type.

The reference parameter in searchItems() must have been set accordingly
to the requested domain to get the items. Otherwise, no items will be
returned by this method.

@param string $domain Name of the domain (e.g. product, text, etc.)
@param string|null $type Name of the item type
@param string|null $listtype Name of the list item type
@return array List of items implementing MShop_Common_Item_Interface
Returns the product text etc . items filtered by domain and optionally by type and list type .