private function _updateUsage( $id, MShop_Catalog_Item_Interface $item, $case = false )
	{
		$date = date( 'Y-m-d H:i:s' );
		$context = $this->_getContext();

		$dbm = $context->getDatabaseManager();
		$dbname = $this->_getResourceName();
		$conn = $dbm->acquire( $dbname );

		try
		{
			$siteid = $context->getLocale()->getSiteId();

			if( $case !== true ) {
				$path = 'mshop/catalog/manager/default/item/usage/update';
			} else {
				$path = 'mshop/catalog/manager/default/item/usage/add';
			}

			$stmt = $conn->create( $context->getConfig()->get( $path, $path ) );
			$stmt->bind( 1, json_encode( $item->getConfig() ) );
			$stmt->bind( 2, $date ); // mtime
			$stmt->bind( 3, $context->getEditor() );

			if( $case !== true )
			{
				$stmt->bind( 4, $siteid, MW_DB_Statement_Abstract::PARAM_INT );
				$stmt->bind( 5, $id, MW_DB_Statement_Abstract::PARAM_INT );
			}
			else
			{
				$stmt->bind( 4, $date ); // ctime
				$stmt->bind( 5, $siteid, MW_DB_Statement_Abstract::PARAM_INT );
				$stmt->bind( 6, $id, MW_DB_Statement_Abstract::PARAM_INT );
			}

			$stmt->execute()->finish();

			$dbm->release( $conn, $dbname );
		}
		catch( Exception $e )
		{
			$dbm->release( $conn, $dbname );
			throw $e;
		}
	}
private function _updateUsage( $id, MShop_Catalog_Item_Interface $item, $case = false )
	{
		$date = date( 'Y-m-d H:i:s' );
		$context = $this->_getContext();

		$dbm = $context->getDatabaseManager();
		$dbname = $this->_getResourceName();
		$conn = $dbm->acquire( $dbname );

		try
		{
			$siteid = $context->getLocale()->getSiteId();

			if( $case !== true ) {
				$path = 'mshop/catalog/manager/default/item/usage/update';
			} else {
				$path = 'mshop/catalog/manager/default/item/usage/add';
			}

			$stmt = $conn->create( $context->getConfig()->get( $path, $path ) );
			$stmt->bind( 1, json_encode( $item->getConfig() ) );
			$stmt->bind( 2, $date ); // mtime
			$stmt->bind( 3, $context->getEditor() );

			if( $case !== true )
			{
				$stmt->bind( 4, $siteid, MW_DB_Statement_Abstract::PARAM_INT );
				$stmt->bind( 5, $id, MW_DB_Statement_Abstract::PARAM_INT );
			}
			else
			{
				$stmt->bind( 4, $date ); // ctime
				$stmt->bind( 5, $siteid, MW_DB_Statement_Abstract::PARAM_INT );
				$stmt->bind( 6, $id, MW_DB_Statement_Abstract::PARAM_INT );
			}

			$stmt->execute()->finish();

			$dbm->release( $conn, $dbname );
		}
		catch( Exception $e )
		{
			$dbm->release( $conn, $dbname );
			throw $e;
		}
	}
private function _updateUsage ( $ id , MShop_Catalog_Item_Interface $ item , $ case = false ) { $ date = date ( 'Y-m-d H:i:s' ) ; $ context = $ this -> _getContext ( ) ; $ dbm = $ context -> getDatabaseManager ( ) ; $ dbname = $ this -> _getResourceName ( ) ; $ conn = $ dbm -> acquire ( $ dbname ) ; try { $ siteid = $ context -> getLocale ( ) -> getSiteId ( ) ; if ( $ case !== true ) { $ path = 'mshop/catalog/manager/default/item/usage/update' ; } else { $ path = 'mshop/catalog/manager/default/item/usage/add' ; } $ stmt = $ conn -> create ( $ context -> getConfig ( ) -> get ( $ path , $ path ) ) ; $ stmt -> bind ( 1 , json_encode ( $ item -> getConfig ( ) ) ) ; $ stmt -> bind ( 2 , $ date ) ; // mtime $ stmt -> bind ( 3 , $ context -> getEditor ( ) ) ; if ( $ case !== true ) { $ stmt -> bind ( 4 , $ siteid , MW_DB_Statement_Abstract :: PARAM_INT ) ; $ stmt -> bind ( 5 , $ id , MW_DB_Statement_Abstract :: PARAM_INT ) ; } else { $ stmt -> bind ( 4 , $ date ) ; // ctime $ stmt -> bind ( 5 , $ siteid , MW_DB_Statement_Abstract :: PARAM_INT ) ; $ stmt -> bind ( 6 , $ id , MW_DB_Statement_Abstract :: PARAM_INT ) ; } $ stmt -> execute ( ) -> finish ( ) ; $ dbm -> release ( $ conn , $ dbname ) ; } catch ( Exception $ e ) { $ dbm -> release ( $ conn , $ dbname ) ; throw $ e ; } }
Updates the usage information of a node.

@param integer $id Id of the record
@param MShop_Catalog_Item_Interface $item Catalog item
@param boolean $case True if the record shoud be added or false for an update
Updates the usage information of a node .