Function that sets data array for pdf rendering.

@param ApiOrderInterface $apiOrder

@return array
771914
protected function getContentForPdf(ApiOrderInterface $apiOrder)
    {
        $order = $apiOrder->getEntity();

        $customerNumber = null;

        if ($order->getCustomerAccount()) {
            $customerNumber = $order->getCustomerAccount()->getNumber();
        } else {
            $customerNumber = sprintf('%05d', $order->getCustomerContact()->getId());
        }

        $data = [
            'recipient' => $order->getDeliveryAddress(),
            'responsibleContact' => $order->getResponsibleContact(),
            'deliveryAddress' => $order->getDeliveryAddress(),
            'customerContact' => $order->getCustomerContact(),
            'billingAddress' => $order->getInvoiceAddress(),
            'order' => $order,
            'customerNumber' => $customerNumber,
            'orderApiEntity' => $apiOrder,
            'itemApiEntities' => $apiOrder->getItems(),
            'templateBasePath' => $this->templateBasePath,
            'templateMacrosPath' => $this->templateMacrosPath,
            'website_locale' => $this->websiteLocale,
        ];

        return $data;
    }
385184
public function updateApiEntity(Order $apiOrder, $locale)
    {
        $items = $apiOrder->getItems();

        // Perform price calculation.
        $groupedPrices = [];
        $supplierItems = [];

        $prices = $this->priceCalculator->calculate(
            $items,
            $apiOrder->getNetShippingCosts(),
            $groupedPrices,
            $supplierItems,
            $this->defaultCurrency
        );

        if ($supplierItems) {
            $supplierItems = array_values($supplierItems);
            // Update media api entities.
            $this->createMediaForSupplierItems($supplierItems, $locale);
            // Set grouped items.
            $apiOrder->setSupplierItems($supplierItems);
        }

        $this->createMediaForItems($items, $locale);

        // Check if any price in cart has changed.
        $hasChangedPrices = false;
        foreach ($items as $item) {
            if ($item->getPriceChange()) {
                $hasChangedPrices = true;
                break;
            }
        }
        $apiOrder->setHasChangedPrices($hasChangedPrices);

        // Set total prices.
        $apiOrder->getEntity()->setTotalNetPrice($prices['totalNetPrice']);
        $apiOrder->getEntity()->setTotalPrice($prices['totalPrice']);
        $apiOrder->getEntity()->setTotalRecurringNetPrice($prices['totalRecurringNetPrice']);
        $apiOrder->getEntity()->setTotalRecurringPrice($prices['totalRecurringPrice']);
        $apiOrder->getEntity()->setShippingCosts($prices['shippingCosts']);
    }
525699
public static function appendOrder(QueryBuilder $queryBuilder, DataTablesWrapperInterface $dtWrapper) {

        foreach ($dtWrapper->getRequest()->getOrder() as $dtOrder) {

            $dtColumn = array_values($dtWrapper->getColumns())[$dtOrder->getColumn()];
            if (false === $dtColumn->getOrderable()) {
                continue;
            }

            $queryBuilder->addOrderBy($dtColumn->getMapping()->getAlias(), $dtOrder->getDir());
        }
    }
698513
protected function setDataPanelLogsIndexOrder()
    {
        $pager_options = array(
            'total' => $this->getTotalLogOrder(),
            'limit' => $this->config('order_log_limit', 5)
        );

        $pager = $this->getPager($pager_options);

        $data = array(
            'order' => $this->data_order,
            'pager' => $pager['rendered'],
            'items' => $this->getListLogOrder($pager['limit'])
        );

        $this->setData('pane_log', $this->render('sale/order/panes/log', $data));
    }
561884
public function create(Model\InStore\Order $order, HandlerStack $stack = null)
    {
        try {
            $params = $this->generateParams($order, $stack);

            $result = $this->getClient()->post('orders', $params);

            return $this->getSerializer()->deserialize(
                (string) $result->getBody(),
                Model\InStore\Order::class,
                'json'
            );
        } catch (BadResponseException $e) {
            throw new ApiException(
                $this->getSerializer()->deserialize(
                    (string) $e->getResponse()->getBody(),
                    Model\ErrorResponse::class,
                    'json'
                ),
                $e
            );
        }
    }
82959
public function toPdfArray()
    {
        $array = new PdfArray();
        $array->value[] = PdfNumeric::create($this->llx);
        $array->value[] = PdfNumeric::create($this->lly);
        $array->value[] = PdfNumeric::create($this->urx);
        $array->value[] = PdfNumeric::create($this->ury);

        return $array;
    }
201033
public function hydrate($data)
    {
        if ($data instanceof \ArrayObject) {
            $data = $data->getArrayCopy();
        }

        if ($data instanceof \Iterator) {
            $data = iterator_to_array($data);
        }

        if (!is_array($data)) {
            throw new ApiClientException('RequestDescriptor need an array, ArrayObject or Iterator instance to get hydrated');
        }

        foreach ($data as $property => $value) {
            $setter = 'set' . ucfirst($property);

            $this->$setter($value);
        }

        return $this;
    }
101705
public function getSuccessLines(Event $event, $apiResponse)
    {
        $data = json_decode($apiResponse);
        if (isset($data->name) && $data->name) {
            return array(
                sprintf(
                    "%s, %s | %s | Temp: %dC | Humidity: %s%% | Sunrise: %s | Sunset: %s",
                    $data->name,
                    $data->sys->country,
                    $data->weather[0]->main,
                    round($data->main->temp - 273.15),
                    $data->main->humidity,
                    date("H:i:s", $data->sys->sunrise),
                    date("H:i:s", $data->sys->sunset)
                )
            );
        } else {
            return $this->getNoResultsLines($event, $apiResponse);
        }
    }
1236840
public function formatOrderBy(array $orderBy) {
        if ($orderBy) {
            $output = [];

            foreach ($orderBy as $field => $direction) {
                if ($direction instanceof Func) {
                    $output[] = $this->formatFunction($direction);
                } else {
                    $output[] = $this->quote($field) . ' ' . $this->getKeyword($direction);
                }
            }

            return sprintf($this->getClause(self::ORDER_BY), implode(', ', $output));
        }

        return '';
    }
673639
public function getSuccessLines(Event $event, $apiResponse)
    {
        $json = json_decode($apiResponse);
        $json = $json->responseData;

        $messages = [];

        $messages[] = sprintf(
            "%s results [ %s ]",
            (isset($json->cursor->estimatedResultCount)) ? $json->cursor->estimatedResultCount : "0",
            $json->cursor->moreResultsUrl
        );

        return $messages;
    }
623485
public function getOrder()
    {
        return new ApiOrder($this->entity->getOrder(), $this->locale, $this->itemFactory, $this->priceFormatter);
    }
639486
protected static function parseOrder(array $rawOrder) {

        $dtOrder = new DataTablesOrder();

        if (false === static::isValidRawOrder($rawOrder)) {
            return $dtOrder;
        }

        $dtOrder->setColumn(intval($rawOrder[DataTablesOrderInterface::DATATABLES_PARAMETER_COLUMN]));
        $dtOrder->setDir($rawOrder[DataTablesOrderInterface::DATATABLES_PARAMETER_DIR]);

        return $dtOrder;
    }
97498
public function getSuccessLines(Event $event, $apiResponse)
    {
        $data = json_decode($apiResponse);
        if (isset($data->current_observation)) {
            $data = $data->current_observation;
            return array(
                sprintf(
                    "%s | %s | Temp: %dC | Humidity: %s | %s",
                    $data->display_location->full,
                    $data->weather,
                    round($data->temp_c),
                    $data->relative_humidity,
                    $data->forecast_url
                )
            );
        } else {
            return $this->getNoResultsLines($event, $apiResponse);
        }
    }
674986
public function setAccessorOrder($order, array $customOrder = []): void
    {
        if (! \in_array($order, [self::ACCESSOR_ORDER_UNDEFINED, self::ACCESSOR_ORDER_ALPHABETICAL, self::ACCESSOR_ORDER_CUSTOM], true)) {
            throw new InvalidArgumentException(\sprintf('The accessor order "%s" is invalid.', $order));
        }

        foreach ($customOrder as $name) {
            if (! \is_string($name)) {
                throw new InvalidArgumentException(\sprintf('$customOrder is expected to be a list of strings, but got element of value %s.', \var_export($name, true)));
            }
        }

        $this->accessorOrder = $order;
        $this->customOrder = \array_flip($customOrder);
        $this->sortProperties();
    }
1148044
public final function setOrderData(Order $order)
    {
        if (get_called_class() != self::class) {
            throw new \InvalidArgumentException("Method can be call only by OrderFinalized entity");
        }
        $this->id = $order->id;
        $this->setProperties($order);
    }
702861
protected function _callOrderRequest(
        $sRequestFunction,
        $oOrder,
        array $aRequestParameters,
        array $aFields,
        &$blProcessable = false,
        $sErrorCode = null
    ) {
        $blProcessable = false;

        //Set default params
        if ($oOrder !== null) {
            $this->_mapOrderToRequestParameters($oOrder, $aRequestParameters, $aFields);
        }

        //Make request and return result
        $this->_addSandboxSimulationParams($sRequestFunction, $aRequestParameters);
        $oData = $this->_convertResponse($this->_getAmazonClient()->{$sRequestFunction}($aRequestParameters));

        //Update Order info
        if ($oOrder !== null) {
            $blProcessable = $this->_setOrderTransactionErrorStatus($oOrder, $oData, $sErrorCode) === false;
        }

        return $oData;
    }
993563
public static function readableAll(string $apiClass, RuleInterface $next = null): RuleInterface
    {
        $primary = new AreReadableViaApiRule($apiClass);

        return $next === null ? $primary : new AndOperator($primary, $next);
    }