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;
	}