protected function _addPrices( $parentid, array $data, $domain )
	{
		$context =  $this->_getContext();
		$mediaManager = MShop_Factory::createManager( $context, 'price' );
		$listManager = MShop_Factory::createManager( $context, $domain . '/list' );


		$item = $mediaManager->createItem();
		$item->setDomain( $domain );

		$listItem = $listManager->createItem();
		$listItem->setParentId( $parentid );
		$listItem->setDomain( 'price' );


		foreach( $data as $entry )
		{
			$item->setId( null );
			$item->setTypeId( $this->_getTypeId( 'price/type', $domain, $entry['type'] ) );
			$item->setCurrencyId( $entry['currencyid'] );
			$item->setQuantity( $entry['quantity'] );
			$item->setValue( $entry['value'] );
			$item->setCosts( $entry['costs'] );
			$item->setRebate( $entry['rebate'] );
			$item->setTaxRate( $entry['taxrate'] );
			$item->setStatus( $entry['status'] );

			$mediaManager->saveItem( $item );

			$listItem->setId( null );
			$listItem->setTypeId( $this->_getTypeId( $domain . '/list/type', 'price', $entry['list-type'] ) );
			$listItem->setDateStart( $entry['list-start'] );
			$listItem->setDateEnd( $entry['list-end'] );
			$listItem->setConfig( $entry['list-config'] );
			$listItem->setPosition( $entry['list-position'] );
			$listItem->setStatus( $entry['list-status'] );
			$listItem->setRefId( $item->getId() );

			$listManager->saveItem( $listItem, false );


			if( isset( $entry['attribute'] ) ) {
				$this->_addAttributes( $item->getId(), $entry['attribute'], 'price' );
			}

			if( isset( $entry['media'] ) ) {
				$this->_addMedia( $item->getId(), $entry['media'], 'price' );
			}

			if( isset( $entry['price'] ) ) {
				$this->_addPrices( $item->getId(), $entry['price'], 'price' );
			}

			if( isset( $entry['text'] ) ) {
				$this->_addTexts( $item->getId(), $entry['text'], 'price' );
			}
		}
	}
protected function _addPrices( $parentid, array $data, $domain )
	{
		$context =  $this->_getContext();
		$mediaManager = MShop_Factory::createManager( $context, 'price' );
		$listManager = MShop_Factory::createManager( $context, $domain . '/list' );


		$item = $mediaManager->createItem();
		$item->setDomain( $domain );

		$listItem = $listManager->createItem();
		$listItem->setParentId( $parentid );
		$listItem->setDomain( 'price' );


		foreach( $data as $entry )
		{
			$item->setId( null );
			$item->setTypeId( $this->_getTypeId( 'price/type', $domain, $entry['type'] ) );
			$item->setCurrencyId( $entry['currencyid'] );
			$item->setQuantity( $entry['quantity'] );
			$item->setValue( $entry['value'] );
			$item->setCosts( $entry['costs'] );
			$item->setRebate( $entry['rebate'] );
			$item->setTaxRate( $entry['taxrate'] );
			$item->setStatus( $entry['status'] );

			$mediaManager->saveItem( $item );

			$listItem->setId( null );
			$listItem->setTypeId( $this->_getTypeId( $domain . '/list/type', 'price', $entry['list-type'] ) );
			$listItem->setDateStart( $entry['list-start'] );
			$listItem->setDateEnd( $entry['list-end'] );
			$listItem->setConfig( $entry['list-config'] );
			$listItem->setPosition( $entry['list-position'] );
			$listItem->setStatus( $entry['list-status'] );
			$listItem->setRefId( $item->getId() );

			$listManager->saveItem( $listItem, false );


			if( isset( $entry['attribute'] ) ) {
				$this->_addAttributes( $item->getId(), $entry['attribute'], 'price' );
			}

			if( isset( $entry['media'] ) ) {
				$this->_addMedia( $item->getId(), $entry['media'], 'price' );
			}

			if( isset( $entry['price'] ) ) {
				$this->_addPrices( $item->getId(), $entry['price'], 'price' );
			}

			if( isset( $entry['text'] ) ) {
				$this->_addTexts( $item->getId(), $entry['text'], 'price' );
			}
		}
	}
protected function _addPrices ( $ parentid , array $ data , $ domain ) { $ context = $ this -> _getContext ( ) ; $ mediaManager = MShop_Factory :: createManager ( $ context , 'price' ) ; $ listManager = MShop_Factory :: createManager ( $ context , $ domain . '/list' ) ; $ item = $ mediaManager -> createItem ( ) ; $ item -> setDomain ( $ domain ) ; $ listItem = $ listManager -> createItem ( ) ; $ listItem -> setParentId ( $ parentid ) ; $ listItem -> setDomain ( 'price' ) ; foreach ( $ data as $ entry ) { $ item -> setId ( null ) ; $ item -> setTypeId ( $ this -> _getTypeId ( 'price/type' , $ domain , $ entry [ 'type' ] ) ) ; $ item -> setCurrencyId ( $ entry [ 'currencyid' ] ) ; $ item -> setQuantity ( $ entry [ 'quantity' ] ) ; $ item -> setValue ( $ entry [ 'value' ] ) ; $ item -> setCosts ( $ entry [ 'costs' ] ) ; $ item -> setRebate ( $ entry [ 'rebate' ] ) ; $ item -> setTaxRate ( $ entry [ 'taxrate' ] ) ; $ item -> setStatus ( $ entry [ 'status' ] ) ; $ mediaManager -> saveItem ( $ item ) ; $ listItem -> setId ( null ) ; $ listItem -> setTypeId ( $ this -> _getTypeId ( $ domain . '/list/type' , 'price' , $ entry [ 'list-type' ] ) ) ; $ listItem -> setDateStart ( $ entry [ 'list-start' ] ) ; $ listItem -> setDateEnd ( $ entry [ 'list-end' ] ) ; $ listItem -> setConfig ( $ entry [ 'list-config' ] ) ; $ listItem -> setPosition ( $ entry [ 'list-position' ] ) ; $ listItem -> setStatus ( $ entry [ 'list-status' ] ) ; $ listItem -> setRefId ( $ item -> getId ( ) ) ; $ listManager -> saveItem ( $ listItem , false ) ; if ( isset ( $ entry [ 'attribute' ] ) ) { $ this -> _addAttributes ( $ item -> getId ( ) , $ entry [ 'attribute' ] , 'price' ) ; } if ( isset ( $ entry [ 'media' ] ) ) { $ this -> _addMedia ( $ item -> getId ( ) , $ entry [ 'media' ] , 'price' ) ; } if ( isset ( $ entry [ 'price' ] ) ) { $ this -> _addPrices ( $ item -> getId ( ) , $ entry [ 'price' ] , 'price' ) ; } if ( isset ( $ entry [ 'text' ] ) ) { $ this -> _addTexts ( $ item -> getId ( ) , $ entry [ 'text' ] , 'price' ) ; } } }
Adds the prices to the given parent in the database.

@param string $parentid ID of the parent item where the media should be associated to
@param array $data Two dimensional associative list of price data
@param string $domain Domain name the texts should be added to, e.g. 'catalog'
Adds the prices to the given parent in the database .