@param Index[] $indexes
@param array   $options

@return \string[]
16064
public function createIndexes(array $indexes, array $options = [])
    {
        if (empty($indexes)) {
            throw new InvalidArgumentException('$indexes array cannot be empty.');
        }

        $compiledIndexes = array_map(function (Index $index) {
            return $index->toArray();
        }, $indexes);

        $this->executeCommand(
            ['createIndexes' => $this->collectionName, 'indexes' => $compiledIndexes],
            $options
        );

        return array_map(function (Index $index) {
            return $index->getName();
        }, $indexes);
    }
112723
public function searchFilter($searchFilters, $options = [])
    {
        $_options = [];

        $options = array_merge($_options, $options);

        return ($searchFilters ? $this->Search->filterForm($searchFilters) : null);
    }
612143
protected function getOptions(array  $options): array
    {
        $options['format'] = array_get($options, 'format', $this->format);
        $options['locale'] = array_get($options, 'locale', config('app.locale'));

        return $options;
    }
762761
private function createRiakIndexList(array $indexes)
    {
        $list = [];

        foreach ($indexes as $fullName => $values) {
            $list[] = RiakIndex::fromFullname($fullName, $values);
        }

        return new RiakIndexList($list);
    }
672627
public function createIndex(array $key, array $options = [])
    {
        $commandOptions = [];
        if (isset($options['writeConcern'])) {
            $commandOptions['writeConcern'] = $options['writeConcern'];
            unset($options['writeConcern']);
        }
        $index = new Index($key, $options);

        return current($this->createIndexes([$index], $commandOptions));
    }
317888
public static function rowsToArray($rows, array $options = [])
    {
        $limit = array_get($options, 'limit', 0);
        $offset = array_get($options, 'offset', 0);

        $array = [];
        if ($offset > 0) {
            if ($limit > 0) {
                for ($i = 0; ($i < $limit && $rows->offsetExists($offset + $i)); $i++) {
                    $array[] = $rows->offsetGet($offset + $i);
                }
            } else {
                for ($i = 0; $rows->offsetExists($offset + $i); $i++) {
                    $array[] = $rows->offsetGet($offset + $i);
                }
            }
        } else {
            foreach ($rows as $row) {
                $array[] = $row;
            }
        }

        return $array;
    }
336386
public function getAllParents(array $options = []): array
    {
        $options = array_replace(
            [
                'indexById'     => false,
                'skipIds'       => []
            ],
            $options
        );
        $parents = [];
        $ids = [$this->getId()];

        /** @var NodeInterface $parent */
        foreach ($this->getParents() as $id => $parent) {
            if (in_array($id, $options['skipIds'])) {
                continue;
            }

            $ids[] = $id;

            if ($options['indexById']) {
                $parents[$id] = $parent;
            } else {
                $parents[] = $parent;
            }

            $parents = array_merge(
                $parents,
                $parent->getAllParents(array_merge($options, ['skipIds' => $ids]))
            );
        }

        return $parents;
    }
720085
public function dropIndexes($indexes)
    {
        $result = $this->database->createCommand()->dropIndexes($this->name, $indexes);
        return $result['nIndexesWas'];
    }
957218
public function fromArray($options)
    {
        if (isset($options['Index'])) {
            Validate::isInteger($options['Index'], 'options[Index]');
            $this->_index = (int) $options['Index'];
        }

        if (isset($options['Language'])) {
            Validate::isString($options['Language'], 'options[Language]');
            $this->_language = $options['Language'];
        }
    }
98773
private function getCollectionOptionsHash(array $options)
    {
        ksort($options);
        $str = '';
        foreach ($options as $option) {
            if (!$option instanceof  Serializable) {
                // All valid Collection options are BSON serializable
                continue;
            }
            $str .= serialize($option->bsonSerialize());
        }

        return md5($str);
    }
524536
public static function getList(array $options = array())
    {
        $api = new Api\GetService();
        $result = $api->doRequest();
        $paymentMethods = self::reorderOutput($result);

        if (isset($options['country'])) {
            $paymentMethods = self::filterCountry($paymentMethods, $options['country']);
        }

        return $paymentMethods;
    }
297569
public function getArray(array $options = array()): array
    {
        $content = $this->getContent();

        if (is_null($content)) {
            return (array)$content;
        }

        return json_decode($this->content, true);
    }
787326
public function ensureIndex(array $keys, array $options = array())
    {
        $options = isset($options['safe']) ? $this->convertWriteConcern($options) : $options;
        $options = isset($options['timeout']) ? $this->convertSocketTimeout($options) : $options;
        $options = isset($options['wtimeout']) ? $this->convertWriteTimeout($options) : $options;

        return $this->riakCollection->ensureIndex($keys, $options);
    }
1012603
protected function _dynamicSelectStructure(array $options) : array
    {
        $result = [];
        foreach ($options as $k => $v) {
            $result[$v['label']] = !empty($v['children']) ? $this->_dynamicSelectStructure($v['children']) : [];
        }

        return $result;
    }
1128498
public static function create(array $tokens, array $options = []) {
        HashMap::assert($tokens, 'tokens');

        $operation = SqlOperation::create($tokens);
        if ($operation !== SqlOperations::SELECT) return null;

        $query = implode('&', array_filter([
            self::createConditionals($tokens),
            self::createPagination($tokens, $options),
        ]));

        return $query;
    }
1233122
private function getRequestOptions(array $options)
    {
        $restOptions = isset($options['restOptions'])
            ? $options['restOptions']
            : $this->restOptions;
        $timeout = isset($options['requestTimeout'])
            ? $options['requestTimeout']
            : $this->requestTimeout;

        if ($timeout && !array_key_exists('timeout', $restOptions)) {
            $restOptions['timeout'] = $timeout;
        }

        return $restOptions;
    }
1359933
public function buildFilters($options) {
        if (empty($options['filters']) || !is_array($options['filters'])) return [];
        return array_filter(array_map(function($filter) {
            if (empty($this->config['filters'][$filter])) return;
            return new $this->config['filters'][$filter];
        }, $options['filters']));
    }