prepare
@return array
492040
public function prepare() {
        $sql = $this->getSql();
        $params = array_merge($this->whereParams(), $this->having_params);
        return [$sql, $params];
    }
885019
protected function prepareStockItemAttributes()
    {
        return array_merge($this->prepareAttributes(), $this->attributeLoader->load($this, $this->getHeaderStockMappings()));
    }
20935
protected function prepareAttributes()
    {

        // load the product bundle option name
        $name = $this->getValue(ColumnKeys::BUNDLE_VALUE_NAME);

        // load the actual option ID
        $optionId = $this->getLastOptionId();

        try {
            // load and map the parent SKU
            $parentProductId = $this->mapSku($this->getValue(ColumnKeys::BUNDLE_PARENT_SKU));
        } catch (\Exception $e) {
            throw $this->wrapException(array(ColumnKeys::BUNDLE_PARENT_SKU), $e);
        }

        // load the store/website ID
        $store = $this->getStoreByStoreCode($this->getStoreViewCode(StoreViewCodes::ADMIN));
        $storeId = $store[MemberNames::STORE_ID];

        // return the prepared product
        return $this->initializeEntity(
            array(
                MemberNames::OPTION_ID         => $optionId,
                MemberNames::PARENT_PRODUCT_ID => $parentProductId,
                MemberNames::STORE_ID          => $storeId,
                MemberNames::TITLE             => $name
            )
        );
    }
693692
private function prepareData()
    {
        $data = [];
        foreach (get_object_vars($this) as $property => $value) {
            if (in_array($property, ['apiHost', 'debug'])) {
                continue;
            }

            if ($property == 'format') {
                $data[$value] = '';
            } elseif (is_bool($value) && $value) {
                $data[$property] = '';
            } elseif (!is_null($value) && !is_bool($value)) {
                if (is_array($value)) {
                    foreach ($value as $key => $val) {
                        $value[$key] = $val;
                    }
                } else {
                    $value = $value;
                }

                $data[$property] = $value;
            }
        }

        if (empty($data) && $this->debug) {
            throw new \Exception('Query have not data');
        }

        $data = http_build_query($data);

        return $data;
    }
1227558
public function prepareRequest()
    {
        $version = $this->versionEngine->getVersion();
        $queryConfiguration = $version->parseRequest($this->columnConfigurations);
        $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);

        return [
            'version' => $version,
            'queryConfiguration' => $queryConfiguration
        ];
    }
355132
protected function prepareAttributes()
    {

        // initialize the values that has to be updated
        $updatedAt = date('Y-m-d H:i:s');
        $childrenCount = $this->loadCategoryChildrenChildrenCount($this->category[MemberNames::PATH] . '/%');

        // prepare and return the array with the updated values
        return array(
            MemberNames::UPDATED_AT     => $updatedAt,
            MemberNames::CHILDREN_COUNT => $childrenCount
        );
    }
440280
private function prepareData()
    {
        $parser = $this->getUserAgentParser();

        return [
            'name'            => $parser->getOriginalUserAgent() ?: 'Other',
            'browser'         => $parser->getBrowser(),
            'browser_version' => $parser->getUserAgentVersion(),
        ];
    }
1022884
protected function prepare()
    {
        //Force passice mode if not specified
        $this->addOption('passive', true);

        //To make call on different files, we must retrieve the root and apply commands to the path
        $tmp = clone $this->getUrl();
        $tmp->path('');
        $this->addOption('url', $tmp->toString());
    }
703486
protected function prepareLanguages()
    {
        $options = [];
        foreach ($this->options['languages'] as $language) {
            $options[] = $this->prepareLanguage($language);
        }
        
        return $options;
    }
13088
private function prepareSortOrders()
    {
        $sortOrders = [];

        foreach ($this->_orders as $attribute => $direction) {
            $sortParams = ['direction' => $direction];
            $sortField = $attribute;
            $sortOrders[$sortField] = $sortParams;
        }

        return $sortOrders;
    }
717486
public function getPreparedValues()
    {
        $preparedValues = [];
        foreach ($this->getAll() as $name => $values) {
            $preparedValues = array_merge($preparedValues, $this->prepareValues($name, $values));
        }

        return $preparedValues;
    }
1285100
public function prepare()
    {
        if ($this->ready) {
            return null;
        }

        $this->ready = true;

        $format     = $this->format;
        $controller = $this->controller;

        foreach ($this->classMethods as $value) {
            if ($format === self::BOTH || $format === self::SLASH) {
                $route = '/' . (empty($value[1]) ? '' : ($value[1] . '/'));

                Route::set($value[0], $route, $controller . ':' . $value[2]);
            }

            if ($format === self::BOTH || $format === self::NOSLASH) {
                $route = empty($value[1]) ? '' : ('/' . $value[1]);

                Route::set($value[0], $route, $controller . ':' . $value[2]);
            }
        }

        $controller = $classMethods = null;
    }
281779
public function toArray()
    {
        return [
            'methods'    => $this->methods,
            'uri'        => $this->uri,
            'params'     => $this->params,
            'action'     => $this->action,
            'name'       => $this->name,
            'middleware' => $this->middleware,
            'domain'     => $this->domain,
        ];
    }
985568
protected function prepareInput()
    {
        if ($this->input instanceof Bag) {
            return;
        }

        $input = array();

        if ($_SERVER['REQUEST_METHOD'] == "POST") {

            $xmlInput = file_get_contents('php://input');

            $array = XML::parse($xmlInput);

            if (isset($array['Encrypt'])) {
                $this->encryptStr = $array['Encrypt'];
            }

            $input = $this->getCrypt()->decryptMsg(
                    $_REQUEST['msg_signature'],
                    $_REQUEST['nonce'],
                    $_REQUEST['timestamp'],
                    $xmlInput
                );
        }

        $this->input = new Bag(array_merge($_REQUEST, (array) $input));

    }
43451
private function prepareItems()
    {
        $itens = array();

        if($this->_detailsTransactionByCode->getItemCount() > 0) {
            foreach ($this->_detailsTransactionByCode->getItems() as $item)
            {
                $itens[] = array(
                    'id'            => $item->getId(),
                    'description'   => $item->getDescription(),
                    'quantity'      => $item->getQuantity(),
                    'amount'        => $item->getAmount(),
                    'weight'        => $item->getWeight(),
                    'shippingCost'  => $item->getShippingCost()
                );
            }
        }
        return $itens;
    }
359880
public function prepare()
    {
        $this->startedAt = microtime(true);

        if ($this->getOption('debug')) {
            $this->logger->setLevel(LogLevel::DEBUG);
        } elseif ($this->getOption('verbose')) {
            $this->logger->setLevel(LogLevel::INFO);
        } elseif ($this->getOption('quiet')) {
            $this->logger->setLevel(LogLevel::ERROR);
        } elseif ($this->config('debug', false)) {
            $this->logger->setLevel(LogLevel::DEBUG);
        } elseif ($this->config('verbose', false)) {
            $this->logger->setLevel(LogLevel::INFO);
        }

        return true;
    }
1124431
public function prepare_to_cache() {
        return array(
            'class' => get_class($this),
            'id' => $this->id,
            'ctxid' => $this->context->id,
            'options' => $this->options,
            'readonly' => $this->readonly
        );
    }