public function saveItem( MShop_Common_Item_Interface $item, $fetch = true )
	{
		$iface = 'MShop_Catalog_Item_Interface';
		if( !( $item instanceof $iface ) ) {
			throw new MShop_Catalog_Exception( sprintf( 'Object is not of required type "%1$s"', $iface ) );
		}

		$siteid = $this->_getContext()->getLocale()->getSiteId();
		$node = $item->getNode();
		$this->begin();

		try
		{
			$this->_createTreeManager( $siteid )->saveNode( $node );
			$this->_updateUsage( $node->getId(), $item );
			$this->commit();
		}
		catch( Exception $e )
		{
			$this->rollback();
			throw $e;
		}
	}
public function saveItem( MShop_Common_Item_Interface $item, $fetch = true )
	{
		$iface = 'MShop_Catalog_Item_Interface';
		if( !( $item instanceof $iface ) ) {
			throw new MShop_Catalog_Exception( sprintf( 'Object is not of required type "%1$s"', $iface ) );
		}

		$siteid = $this->_getContext()->getLocale()->getSiteId();
		$node = $item->getNode();
		$this->begin();

		try
		{
			$this->_createTreeManager( $siteid )->saveNode( $node );
			$this->_updateUsage( $node->getId(), $item );
			$this->commit();
		}
		catch( Exception $e )
		{
			$this->rollback();
			throw $e;
		}
	}
public function saveItem ( MShop_Common_Item_Interface $ item , $ fetch = true ) { $ iface = 'MShop_Catalog_Item_Interface' ; if ( ! ( $ item instanceof $ iface ) ) { throw new MShop_Catalog_Exception ( sprintf ( 'Object is not of required type "%1$s"' , $ iface ) ) ; } $ siteid = $ this -> _getContext ( ) -> getLocale ( ) -> getSiteId ( ) ; $ node = $ item -> getNode ( ) ; $ this -> begin ( ) ; try { $ this -> _createTreeManager ( $ siteid ) -> saveNode ( $ node ) ; $ this -> _updateUsage ( $ node -> getId ( ) , $ item ) ; $ this -> commit ( ) ; } catch ( Exception $ e ) { $ this -> rollback ( ) ; throw $ e ; } }
Updates an item object.

@param MShop_Common_Item_Interface $item Item object whose data should be saved
@param boolean $fetch True if the new ID should be returned in the item
Updates an item object .