Возвращает имена типов, которые должны присутствовать в выборке
@throws InvalidArgumentException если заданы невозможные условия выборки
@return array
171543
protected function getSelectionTypes()
    {
        if (!count($this->usedFields)) {
            return array_keys($this->types);
        }
        $fields = array_keys($this->usedFields);

        if (!count($this->types)) {
            $types = $this->metadata->getTypesByFields($fields);
            if (!count($types)) {
                throw new InvalidArgumentException($this->translate(
                    'The selection is not possible. Conditions do not match metadata types.'
                ));
            }
            if (!count(array_diff($this->metadata->getTypesList(), $types))) {
                $types = [];
            }

            return $types;
        }

        $types = array_keys($this->types);
        $typesCount = count($types);
        if (count(array_intersect($this->metadata->getTypesByFields($fields), $types)) != $typesCount) {
            throw new InvalidArgumentException($this->translate(
                'The selection is not possible. Conditions do not match metadata types.'
            ));
        }

        return $types;
    }
1106790
public function getArray()
    {
        $options = [];

        if ($this->isDisabled() || $this->canHaveValue() && empty($this->values)) {
            return $options;
        }

        foreach ($this->values as $value) {
            $options[] = $this->flag();
            $options[] = $value;
        }

        if (empty($options)) {
            $options[] = $this->flag();
        }

        return $options;
    }
392703
public function toArray()
    {
        return [
            'unique_id' => $this->uniqueId,
            'id' => $this->id,
            'name' => $this->name,
            'price' => $this->price,
            'quantity' => $this->quantity,
            'options' => $this->options,
        ];
    }
778341
public function toArray()
    {
        return array(

            'callableName'             => $this->callableName,
            'methodName'               => $this->methodName,
            'realCallableName'         => $this->realCallableName,
            'jobPrefix'                => $this->jobPrefix,
            'realCallableNameNoPrefix' => $this->realCallableNameNoPrefix,
            'description'              => $this->description,
            'iterations'               => $this->iterations,
            'minimumExecutionTime'     => $this->minimumExecutionTime,
            'timeout'                  => $this->timeout,
            'servers'                  => $this->servers,
            'defaultMethod'            => $this->defaultMethod,
        );
    }
1140038
public function getArguments()
    {
        if (empty($this->_arguments)) {
            $base = [];
            if (isset($this->_params['trailing'])) {
                $base = explode('/', $this->_params['trailing']);
            }
            $names = ['controller', 'action', 'namespace', 'trailing'];
            foreach ($this->_params as $key => $value) {
                if (in_array($key, $names)) {
                    continue;
                }
                $this->_arguments[$key] = $value;
            }

            $this->_arguments = array_merge($this->_arguments, $base);
        }
        return $this->_arguments;
    }
786211
public function getArgs(): array
	{
		$input = [];

		$input['merchantId'] = $this->config->merchantId;
		$input['accountId'] = $this->config->accountId;

		$value = $this->value;
		if ($value !== null) {
			$input['value'] = number_format($value, 2, '.', '');
		}

		if ($this->currency !== null) {
			$input['currency'] = $this->currency;
		}

		if ($this->description !== null) {
			$input['description'] = $this->description;
		}

		if ($this->merchantData !== null) {
			$input['merchantData'] = $this->merchantData;
		}

		if ($this->customerData !== null) {
			$input['customerData'] = $this->customerData;
		}

		if ($this->customerEmail !== null) {
			$input['customerEmail'] = $this->customerEmail;
		}

		if ($this->returnUrl !== null) {
			$input['returnUrl'] = $this->returnUrl;
		}

		if ($this->backToEshopUrl !== null) {
			$input['backToEshopUrl'] = $this->backToEshopUrl;
		}

		if ($this->methodId !== null) {
			$input['methodId'] = $this->methodId;
		}

		if ($this->deposit !== null) {
			$input['deposit'] = $this->getDeposit() ? '1' : '0';
		}

		if ($this->isRecurring !== null) {
			$input['isRecurring'] = $this->getIsRecurring() ? '1' : '0';
		}

		if ($this->merchantSpecificSymbol !== null) {
			$input['merchantSpecificSymbol'] = $this->merchantSpecificSymbol;
		}

		if ($this->eetDph !== null && !$this->eetDph->isEmpty()) {
			$input = array_merge($input, $this->eetDph->toArray());
		}

		return $input;
	}
607487
public function getLinesFromFile() : array
    {
        $filename = $this->filename;

        if (!file_exists($filename)) {
            throw new \InvalidArgumentException("File not found: {$filename}");
        }

        return (array) file($filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
    }
672455
public function fetch()
    {
        $ret = array();
        $pos = 0;
        $len = count($this->_arguments);

        foreach ($this->_descriptors as $name => $descriptor) {
            $value = $descriptor->getDefault();

            for ($i = $pos; ; $i++) {
                if ($i < $len && $descriptor->match($this->_arguments[$i])) {
                    $value = $this->_arguments[$i];
                    $pos = $i + 1;
                    break;
                } else {
                    if ($descriptor->isRequired()) {
                        throw new InvalidArgumentException(
                            "Argument is required: `$name`"
                        );
                    }
                    if ($i > $len - 1) {
                        break;
                    }
                }
            }

            $ret[$name] = $value;
        }

        return $ret;
    }
437913
public function toArray()
    {
        return array(
            //'name' => $this->param->getName(),
            'optional' => $this->param->isOptional(),
            'default' => $this->param->isDefaultValueAvailable() ? $this->param->getDefaultValue() : null
        );
    }
1142144
protected function getArguments(): array
    {
        Factory::helper('string');
        $aArguments = [];

        if (!empty($this->aArguments)) {
            foreach ($this->aArguments as $aArgument) {
                $aArguments[] = (object) [
                    'name'     => getFromArray('name', $aArgument),
                    'value'    => $this->oInput->getArgument(getFromArray('name', $aArgument)),
                    'required' => getFromArray('required', $aArgument),
                ];
            }
        } else {
            $aArgumentsRaw = array_slice($this->oInput->getArguments(), 1);
            foreach ($aArgumentsRaw as $sField => $sValue) {
                $sField       = strtoupper(camelcase_to_underscore($sField));
                $aArguments[] = (object) [
                    'name'     => $sField,
                    'value'    => $sValue,
                    'required' => true,
                ];
            }
        }

        unset($sField);
        unset($sValue);

        foreach ($aArguments as &$oArgument) {
            if (empty($oArgument->value)) {
                $sLabel = str_replace('_', ' ', $oArgument->name);
                $sLabel = ucwords(strtolower($sLabel));
                $sError = '';
                do {
                    $oArgument->value = $this->ask($sError . $sLabel . ':', '');
                    $sError           = '<error>Please specify</error> ';
                    if ($oArgument->required && empty($oArgument->value)) {
                        $bAskAgain = true;
                    } else {
                        $bAskAgain = false;
                    }
                } while ($bAskAgain);
            }
        }
        unset($oArgument);

        //  Finally set as key values
        $aOut = [];
        foreach ($aArguments as $oArgument) {
            $aOut[strtoupper($oArgument->name)] = $oArgument->value;
        }

        return $aOut;
    }
727810
public function toArray(): array
    {
        $config = [];

        if ($this->config->has('key')) {
            $config['key'] = $this->getKey();
        } else {
            $config['key'] = Key::generate($this->getKey(), 'field');
        }

        if ($this->config->has('conditional_logic')) {
            $config['conditional_logic'] = $this->getConditionalLogic();
        }

        if ($this->config->has('layouts')) {
            $config['layouts'] = $this->getLayouts();
        }

        if ($this->config->has('sub_fields')) {
            $config['sub_fields'] = $this->getSubFields();
        }

        return array_merge($this->config->toArray(), $config);
    }
453468
public function toArray(): array
    {
        return  [
            'countryCode' => $this->getCountryCode(),
            'vatNumber'   => $this->getVatNumber(),
            'requestDate' => $this->getRequestDate()->format('Y-m-d'),
            'valid'       => $this->isValid(),
            'name'        => $this->getName(),
            'address'     => $this->getAddress(),
            'identifier'  => $this->getIdentifier(),
            'nameMatch'   => $this->getNameMatch(),
            'companyTypeMatch' => $this->getCompanyTypeMatch(),
            'streetMatch' => $this->getStreetMatch(),
            'postcodeMatch' => $this->getPostcodeMatch(),
            'cityMatch' => $this->getCityMatch(),
        ];
    }
1318549
public function toArray(): array
    {
        if (!$this->hasParam('filter')) {
            throw new InvalidException('Filter is required');
        }

        $array = [
            'filter' => $this->getParam('filter')->toArray(),
        ];

        if ($this->_aggs) {
            $array['aggs'] = $this->_convertArrayable($this->_aggs);
        }

        return $array;
    }
923185
protected function getParamsArray()
    {
        return array(
            'tabbed' => $this->tabbed,
            'includeRelations' => $this->includeRelations,
            'restrictFields' => $this->restrictFields,
            'fieldClasses' => $this->fieldClasses,
            'ajaxSafe' => $this->ajaxSafe
        );
    }
1192400
public function getInvalidErrors()
    {
        return array_combine(
            array_keys($this->invalidAttribs),
            array_map(function ($ref) {
                return $ref['error'];
            }, array_values($this->invalidAttribs))
        );
    }
614618
public function toArray()
    {
        return [
            'name' => $this->name,
            'class-name' => $this->className,
            'path' => $this->path,
            'is-create' => $this->isCreate,
            'is-virtual' => $this->isVirtual,
            'is-organized' => $this->isOrganized,
            'with-soft-delete' => $this->withSoftDelete,
            'without-timestamps' => $this->withoutTimestamps,
            'resource' => ($this->resource ?: new Resource())->toArray(),
        ];
    }
46605
public function toArray()
    {
        if ($this->field === null || $this->value === null) {
            throw new InvalidArgument('"field" and "value" must be set for this type of query');
        }

        $definition = [
            'value' => $this->getValue(),
        ];

        if ($this->hasBoost()) {
            $definition['boost'] = $this->getBoost();
        }

        if (!empty($this->flags)) {
            $definition['flags'] = $this->getFlagsValue();
        }

        if ($this->maxDeterminizedStates !== null) {
            $definition['max_determinized_states'] = $this->maxDeterminizedStates;
        }

        return [
            'regexp' => [
                $this->getField() => $definition,
            ],
        ];
    }