Executes tasks after processing the items.

@param \stdClass $params Associative list of parameters
@return array Associative list with success value
328298
public function finish( \stdClass $params )
	{
		$this->checkParams( $params, array( 'site', 'items' ) );
		$this->setLocale( $params->site );

		$manager = $this->getManager();
		$indexManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'index' );

		$search = $manager->createSearch();
		$search->setConditions( $search->compare( '==', 'product.id', $params->items ) );
		$search->setSlice( 0, count( $params->items ) );

		foreach( $manager->searchItems( $search ) as $item ) {
			$indexManager->saveItem( $item, false );
		}

		$this->clearCache( (array) $params->items );

		return array(
			'success' => true,
		);
	}
471404
public function execute(array $params = []) : array
    {
        foreach ($params as $paramName => $paramValue) {
            $type = is_int($paramValue) ? \SQLITE3_INTEGER : \SQLITE3_TEXT;
            $this->getStatement()->bindValue($paramName, $paramValue, $type);
        }
        $result = $this->getStatement()->execute();

        $results = [];
        while ($row = $result->fetchArray(\SQLITE3_ASSOC)) {
            $results[] = $row;
        }

        return $results;
    }
964556
protected function performRequest(array $params)
    {
        $this->setRawResponse($this->rawResponse);
        $response = explode("\n", $this->rawResponse);

        return $response;
    }
28652
final public static function execute(Parameters $params) {

        if ( $params->protocol() != RpcServer::XMLRPC ) {

            throw new RpcException($params->errors()->get(-31000), -31000);

        }

        $boxcarred_requests = $params->get('requests');

        $results = [];

        foreach ( $boxcarred_requests as $position => $request ) {

            $new_parameters = new Parameters(
                $params->capabilities(),
                $params->methods(),
                $params->errors(),
                $params->logger(),
                $params->protocol()
            );

            $results[$position] = self::singleCall($request, $new_parameters);

        }

        return $results;

    }
726073
public function setParams(array $params = [])
    {

        //Process Params
        $params = $this->processParams($params);

        //Set the params
        $this->params = $params;

        return $this;
    }
848067
public function getTree( stdClass $params )
	{
		$this->_checkParams( $params, array( 'site', 'items' ) );
		$this->_setLocale( $params->site );

		$manager = $this->_getManager();

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

		foreach( $items as $entry )
		{
			$entry = ( $entry != 'root' ? $entry : null );
			$item = $manager->getTree( $entry, array(), MW_Tree_Manager_Abstract::LEVEL_LIST );
			$result[] = $this->_createNodeArray( $item );
		}

		return array(
			'items' => ( !is_array( $params->items ) ? reset( $result ) : $result ),
			'success' => true,
		);
	}
219586
public function get($params = [])
    {
        $result = $this->connection()->get($this->getEndpoint(), $params);

        return $this->collectionFromResult($result);
    }
832269
public function setParamsSort(array $params) {
        if (is_numeric(key($params)) && key($params) == 0) {
            $tmp = [];
            foreach ($params as $key => $value) {
                $tmp[$key + 1] = $value;
            }
            $params = $tmp;
        }

        return $params;
    }
518867
public function insertItems( stdClass $params )
	{
		$this->_checkParams( $params, array( 'site', 'items' ) );
		$this->_setLocale( $params->site );

		$ids = array();
		$manager = $this->_getManager();

		$refId = ( isset( $params->refid ) ? $params->refid : null );
		$parentId = ( isset( $params->parentid ) ? $params->parentid : null );
		$items = ( !is_array( $params->items ) ? array( $params->items ) : $params->items );

		foreach( $items as $entry )
		{
			$item = $this->_createItem( (array) $entry );
			$manager->insertItem( $item, $parentId, $refId );

			$ids[] = $item->getId();
		}

		$this->_clearCache( $ids );

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

		return array(
			'items' => ( !is_array( $params->items ) ? reset( $items ) : $items ),
			'success' => true,
		);
	}
558228
private function invokeAfter(array $namedParams, array $classParams)
    {
        $invoker = new Invoker();
        foreach ($this->after as $function) {
            $invoker->invoke($function, $namedParams, $classParams);
        }
    }
776581
public function runWithParams($params)
    {
        $args = $this->controller->bindActionParams($this, $params);
        Log::debug('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()' . __METHOD__);
        if (Zilf::$app->requestedParams === null) {
            Zilf::$app->requestedParams = $args;
        }

        return call_user_func_array([$this->controller, $this->actionMethod], $args);
    }
70552
final public static function execute(Parameters $params) {

        $asked_method = $params->get('method');

        $method = $params->methods()->get($asked_method);

        if ( is_null($method) ) throw new RpcException("Method not found", -32601);

        return $method->getDescription();

    }
646631
public function searchItems( stdClass $params )
	{
		$this->_checkParams( $params, array( 'site' ) );
		$this->_setLocale( $params->site );

		$total = 0;
		$search = $this->_initCriteria( $this->_getManager()->createSearch(), $params );

		if( isset( $params->domain ) && isset( $params->parentid ) )
		{
			$listManager = MShop_Factory::createManager( $this->_getContext(), $params->domain . '/list' );
			$criteria = $listManager->createSearch();

			$expr = array();
			$expr[] = $criteria->compare( '==', $params->domain . '.list.parentid', $params->parentid );
			$expr[] = $criteria->compare( '==', $params->domain . '.list.domain', 'price' );
			$criteria->setConditions( $criteria->combine( '&&', $expr ) );

			$result = $listManager->searchItems( $criteria );

			$ids = array();
			foreach( $result as $items ) {
				$ids[] = $items->getRefId();
			}

			$expr = array();
			$expr[] = $search->compare( '==', 'price.id', $ids );
			$expr[] = $search->getConditions();
			$search->setConditions( $search->combine( '&&', $expr ) );
		}

		$items = $this->_getManager()->searchItems( $search, array(), $total );

		return array(
			'items' => $this->_toArray( $items ),
			'total' => $total,
			'success' => true,
		);
	}
988166
public function insertItems( stdClass $params )
	{
		$this->_checkParams( $params, array( 'items' ) );

		$manager = $this->_getManager();

		$refId = ( isset( $params->refid ) ? $params->refid : null );
		$parentId = ( ( isset( $params->parentid ) && $params->parentid !== 'root' ) ? $params->parentid : null );
		$items = ( !is_array( $params->items ) ? array( $params->items ) : $params->items );

		foreach( $items as $entry )
		{
			$item = $this->_createItem( (array) $entry );
			$manager->insertItem( $item, $parentId, $refId );

			$entry->{'locale.site.id'} = $item->getId();
		}

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

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

		foreach( $items as $entry )
		{
			$item = $this->_createItem( (array) $entry );
			$this->_manager->saveItem( $item );

			$domains[ $item->getDomain() ] = true;
			$refIds[] = $item->getRefId();
			$ids[] = $item->getId();
		}


		if( isset( $domains['product'] ) )
		{
			$context = $this->_getContext();
			$productManager = MShop_Factory::createManager( $context, 'product' );

			$search = $productManager->createSearch();
			$search->setConditions( $search->compare( '==', 'product.id', $refIds ) );
			$search->setSlice( 0, count( $refIds ) );

			$indexManager = MShop_Factory::createManager( $context, 'catalog/index' );
			$indexManager->rebuildIndex( $productManager->searchItems( $search ) );
		}


		$search = $this->_manager->createSearch();
		$search->setConditions( $search->compare( '==', 'catalog.list.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,
		);
	}
454685
public function moveItems( stdClass $params )
	{
		$this->_checkParams( $params, array( 'items', 'oldparentid', 'newparentid', 'refid' ) );

		$manager = $this->_getManager();

		if( $params->newparentid === 'root' ) {
			$params->newparentid = null;
		}

		$refId = ( isset( $params->refid ) ? $params->refid : null );
		$items = ( !is_array( $params->items ) ? array( $params->items ) : $params->items );

		foreach( $items as $entry ) {
			$manager->moveItem( $entry, $params->oldparentid, $params->newparentid, $refId );
		}

		return array(
			'success' => true,
		);
	}
194409
public function saveItems( \stdClass $params )
	{
		$this->checkParams( $params, array( 'site', 'items' ) );

		$ids = [];
		$manager = $this->getManager();
		$items = ( !is_array( $params->items ) ? array( $params->items ) : $params->items );

		foreach( $items as $entry )
		{
			$langid = ( isset( $entry->{'order.base.languageid'} ) ? $entry->{'order.base.languageid'} : null );
			$currencyid = ( isset( $entry->{'order.base.currencyid'} ) ? $entry->{'order.base.currencyid'} : null );

			$this->setLocale( $params->site, $langid, $currencyid );

			$item = $manager->createItem();
			$item->fromArray( (array) $this->transformValues( $entry ) );
			$item = $manager->saveItem( $item );
			$ids[] = $item->getId();
		}

		return $this->getItems( $ids, $this->getPrefix() );
	}