Creates a new order base item or updates an existing one or a list thereof.

@param \stdClass $params Associative array containing the order base properties
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() );
	}
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,
		);
	}
631748
public function saveItems( \stdClass $params )
	{
		$this->checkParams( $params, array( 'site', 'items' ) );
		$this->setLocale( $params->site );

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

		foreach( $items as $entry )
		{
			$item = $manager->createItem();
			$item->fromArray( (array) $this->transformValues( $entry ) );
			$item = $manager->saveItem( $item );

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

		if( isset( $refIds['product'] ) )
		{
			$this->rebuildIndex( (array) $refIds['product'] );
			$this->clearCache( (array) $refIds['product'], 'product' );
		}

		return $this->getItems( $ids, $this->getPrefix() );
	}
59391
public function createByParams( $params = [], $config = [] ) {

		$model = $this->getModelObject();

		// Required
		$model->orderId = $params[ 'orderId' ];

		// Config
		$config[ 'transaction' ] = $model;

		// Return Transaction
		return parent::createByParams( $params, $config );
	}
447654
public function itemsProcFunc(array &$params)
    {
        $this->init();
        if ($params['row']['pid'] > 0) {
            $contentType = is_array($params['row']['CType']) ? $params['row']['CType'][0] : $params['row']['CType'];
            $listType = is_array($params['row']['list_type']) ? $params['row']['list_type'][0] : $params['row']['list_type'];
            $gridType = is_array($params['row']['tx_gridelements_backend_layout']) ? $params['row']['tx_gridelements_backend_layout'][0] : $params['row']['tx_gridelements_backend_layout'];
            $params['items'] = $this->addColPosListLayoutItems(
                $params['row']['pid'],
                $params['items'],
                $contentType,
                $listType,
                $gridType,
                $params['row']['tx_gridelements_container']
            );
        } else {
            // negative uid_pid values indicate that the element has been inserted after an existing element
            // so there is no pid to get the backendLayout for and we have to get that first
            $existingElement = BackendUtility::getRecordWSOL(
                'tt_content',
                -((int)$params['row']['pid']),
                'pid,CType,tx_gridelements_container'
            );
            if ($existingElement['pid'] > 0) {
                $params['items'] = $this->addColPosListLayoutItems(
                    $existingElement['pid'],
                    $params['items'],
                    $existingElement['CType'],
                    $existingElement['list_type'],
                    $existingElement['tx_gridelements_backend_layout'],
                    $existingElement['tx_gridelements_container']
                );
            }
        }
    }
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,
		);
	}
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,
		);
	}
999987
public static function create($params = null, $options = null)
    {
        $opts = \Stripe\Util\RequestOptions::parse($options);
        if (is_null($opts->apiBase)) {
            $opts->apiBase = Stripe::$apiUploadBase;
        }
        // Manually flatten params, otherwise curl's multipart encoder will
        // choke on nested arrays.
        // TODO: use array_column() once we drop support for PHP 5.4
        $flatParams = [];
        foreach (\Stripe\Util\Util::flattenParams($params) as $pair) {
            $flatParams[$pair[0]] = $pair[1];
        }
        return static::_create($flatParams, $opts);
    }
664929
private function buildParams(\stdClass $params) {
        $children = array();
        $fields = array();
        foreach($params as $subAlias => $value) {
            if(is_array($value)) {
                throw new Exception('Field Value cannot be an array', 400);
            } elseif(is_object($value) && get_class($value) == 'stdClass') {
                $children[] = new Field($value, ucfirst(trim($subAlias)));
            } else { //For current object
                $fields[] = $subAlias;
            }
        }
        $this->setChildren($children);
        $this->setFields($fields);
    }
1330746
public function PaymentOrderCreate(array $params)
    {
        $request = new Request();
        $request->setMethod('POST');

        foreach (array('PaymentPageId', 'Amount', 'Currency', 'MerchantUrls') as $param) {
            if (!isset($params[$param])) {
                throw new InvalidArgumentException($param);
            }
        }

        $params['MerchantId'] = $this->options['merchantId'];
        $request->setContent(json_encode(array('PaymentOrder' => $params)));

        return $this->doRequest('PaymentOrder/Create', $request)->getContentJson();
    }
1257054
public function searchItems( \stdClass $params )
	{
		$this->checkParams( $params, array( 'site' ) );
		$this->setLocale( $params->site );

		$total = 0;
		$manager = $this->getManager();
		$search = $this->initCriteria( $manager->createSearch(), $params );
		$items = $manager->searchItems( $search, [], $total );

		return array(
			'items' => $this->toArray( $items ),
			'total' => $total,
			'success' => true,
		);
	}
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,
		);
	}
370147
public function updateOrder($requestParams)
    {
        $options["headers"] = self::retrieveContentTypeHeader(self::CONTENT_TYPE_JSON);
        $requiredParams = array("offer");
        return $this->client->request($requestParams, $this->_mainTransactionEndpoint . "/" . self::ORDER, "put", $requiredParams, $options);
    }
327432
public function columnsItemsProcFunc(array &$params)
    {
        $this->init($params['row']['pid']);
        $gridContainerId = is_array($params['row']['tx_gridelements_container'])
            ? (int)$params['row']['tx_gridelements_container'][0]
            : (int)$params['row']['tx_gridelements_container'];

        if ($gridContainerId > 0) {
            $gridElement = $this->layoutSetup->cacheCurrentParent($gridContainerId, true);
            $params['items'] = $this->layoutSetup->getLayoutColumnsSelectItems($gridElement['tx_gridelements_backend_layout']);

            $ContentType = is_array($params['row']['CType']) ? $params['row']['CType'][0] : $params['row']['CType'];
            if (!empty($ContentType) && is_array($params['items'])) {
                foreach ($params['items'] as $itemKey => $itemArray) {
                    if ($itemArray[3] !== '' && $itemArray[3] !== '*'
                        && !GeneralUtility::inList($itemArray[3], $ContentType)
                    ) {
                        unset($params['items'][$itemKey]);
                    }
                }
            }
        }
    }
5384
public static function create(array $params)
    {
        $publicKey = $params[self::PublicKey];
        $privateKey = $params[self::PrivateKey];

        $cardParams = new self($publicKey, $privateKey);

        if (array_key_exists(self::Identity, $params)) {
            $cardParams->identity = $params[self::Identity];
        }
        if (array_key_exists(self::PreviousCardID, $params)) {
            $cardParams->previousCardID = $params[self::PreviousCardID];
        }
        if (array_key_exists(self::ExtraFields, $params)) {
            $cardParams->extraFields = $params[self::ExtraFields];
        }

        return $cardParams;
    }
1076995
public function setOrder($sortParam)
    {

        if (!isset($sortParam) || !is_string($sortParam)) return;

        if (substr($sortParam, 0, 1) == '-') {
            $direction = SORT_DESC;
            $sortParam = substr($sortParam, 1);
        } else {
            $direction = SORT_ASC;
        }
        if (array_key_exists($sortParam, $this->attributes)) {
            $this->orderBy = [$sortParam => $direction];
        }
    }
215551
public function importFile( \stdClass $params )
	{
		$this->checkParams( $params, array( 'site', 'items' ) );
		$this->setLocale( $params->site );

		$fs = $this->getContext()->getFilesystemManager()->get( 'fs-admin' );
		$items = ( !is_array( $params->items ) ? array( $params->items ) : $params->items );

		foreach( $items as $path )
		{
			$tmpfile = $fs->readf( $path );

			/** controller/extjs/product/import/text/standard/container/type
			 * Container file type storing all language files of the texts to import
			 *
			 * When exporting texts, one file or content object is created per
			 * language. All those files or content objects are put into one container
			 * file so editors don't have to download one file for each language.
			 *
			 * The container file types that are supported by default are:
			 * * Zip
			 *
			 * Extensions implement other container types like spread sheets, XMLs or
			 * more advanced ways of handling the exported data.
			 *
			 * @param string Container file type
			 * @since 2014.03
			 * @category Developer
			 * @category User
			 * @see controller/extjs/product/import/text/standard/container/format
			 */

			/** controller/extjs/product/import/text/standard/container/format
			 * Format of the language files for the texts to import
			 *
			 * The exported texts are stored in one file or content object per
			 * language. The format of that file or content object can be configured
			 * with this option but most formats are bound to a specific container
			 * type.
			 *
			 * The formats that are supported by default are:
			 * * CSV (requires container type "Zip")
			 *
			 * Extensions implement other container types like spread sheets, XMLs or
			 * more advanced ways of handling the exported data.
			 *
			 * @param string Content file type
			 * @since 2014.03
			 * @category Developer
			 * @category User
			 * @see controller/extjs/product/import/text/standard/container/type
			 * @see controller/extjs/product/import/text/standard/container/options
			 */

			/** controller/extjs/product/import/text/standard/container/options
			 * Options changing the expected format for the texts to import
			 *
			 * Each content format may support some configuration options to change
			 * the output for that content type.
			 *
			 * The options for the CSV content format are:
			 * * csv-separator, default ','
			 * * csv-enclosure, default '"'
			 * * csv-escape, default '"'
			 * * csv-lineend, default '\n'
			 *
			 * For format options provided by other container types implemented by
			 * extensions, please have a look into the extension documentation.
			 *
			 * @param array Associative list of options with the name as key and its value
			 * @since 2014.03
			 * @category Developer
			 * @category User
			 * @see controller/extjs/product/import/text/standard/container/format
			 */
			$container = $this->createContainer( $tmpfile, 'controller/extjs/product/import/text/standard/container' );

			$textTypeMap = [];
			foreach( $this->getTextTypes( 'product' ) as $item ) {
				$textTypeMap[$item->getCode()] = $item->getId();
			}

			foreach( $container as $content ) {
				$this->importTextsFromContent( $content, $textTypeMap, 'product' );
			}

			unlink( $tmpfile );
			$fs->rm( $path );
		}

		return array(
			'success' => true,
		);
	}