public function saveItems( stdClass $params )
	{
		$this->_checkParams( $params, array( 'site', 'items' ) );
		$this->_setLocale( $params->site );

		$ids = array();
		$items = ( !is_array( $params->items ) ? array( $params->items ) : $params->items );

		foreach( $items as $entry )
		{
			$item = $this->_createItem( (array) $entry );
			$this->_manager->saveItem( $item );
			$ids[] = $item->getId();
		}

		$this->_clearCache( $ids );

		$search = $this->_manager->createSearch();
		$search->setConditions( $search->compare( '==', 'price.id', $ids ) );
		$search->setSlice( 0, count( $ids ) );
		$items = $this->_toArray( $this->_manager->searchItems( $search ) );

		return array(
			'items' => ( !is_array( $params->items ) ? reset( $items ) : $items ),
			'success' => true,
		);
	}
public function saveItems( stdClass $params )
	{
		$this->_checkParams( $params, array( 'site', 'items' ) );
		$this->_setLocale( $params->site );

		$ids = array();
		$items = ( !is_array( $params->items ) ? array( $params->items ) : $params->items );

		foreach( $items as $entry )
		{
			$item = $this->_createItem( (array) $entry );
			$this->_manager->saveItem( $item );
			$ids[] = $item->getId();
		}

		$this->_clearCache( $ids );

		$search = $this->_manager->createSearch();
		$search->setConditions( $search->compare( '==', 'price.id', $ids ) );
		$search->setSlice( 0, count( $ids ) );
		$items = $this->_toArray( $this->_manager->searchItems( $search ) );

		return array(
			'items' => ( !is_array( $params->items ) ? reset( $items ) : $items ),
			'success' => true,
		);
	}
public function saveItems ( stdClass $ params ) { $ this -> _checkParams ( $ params , array ( 'site' , 'items' ) ) ; $ this -> _setLocale ( $ params -> site ) ; $ ids = array ( ) ; $ items = ( ! is_array ( $ params -> items ) ? array ( $ params -> items ) : $ params -> items ) ; foreach ( $ items as $ entry ) { $ item = $ this -> _createItem ( ( array ) $ entry ) ; $ this -> _manager -> saveItem ( $ item ) ; $ ids [ ] = $ item -> getId ( ) ; } $ this -> _clearCache ( $ ids ) ; $ search = $ this -> _manager -> createSearch ( ) ; $ search -> setConditions ( $ search -> compare ( '==' , 'price.id' , $ ids ) ) ; $ search -> setSlice ( 0 , count ( $ ids ) ) ; $ items = $ this -> _toArray ( $ this -> _manager -> searchItems ( $ search ) ) ; return array ( 'items' => ( ! is_array ( $ params -> items ) ? reset ( $ items ) : $ items ) , 'success' => true , ) ; }
Creates a new price item or updates an existing one or a list thereof.

@param stdClass $params Associative array containing the text properties
Creates a new price item or updates an existing one or a list thereof .