Get Collection Options

Get all collection summary rows
@param  void
@return mixed Array | null
516828
public function getCollections()
    {
        if ($this->collections) {
            return $this->collections;
        }

        $collectionMapper = ($this->container->dataMapper)('CollectionMapper');

        return $this->collections = $collectionMapper->find();
    }
1266661
protected function _getListFieldsNullVal() {
		$result = [];
		$schema = $this->schema();
		$data = array_filter(
			$schema,
			function ($v, $k) {

				return isset($v['null']) && $v['null'] === true;
			},
			ARRAY_FILTER_USE_BOTH
		);
		if (!empty($data)) {
			$result = array_keys($data);
		}

		return $result;
	}
500899
protected function getOptions($options = null, $default = [])
    {
        if (empty($options)) {
            return $default;
        }
        if ($options instanceof Collection) {
            return $options->toArray();
        }
        if ($options instanceof Closure) {
            return $this->getOptions(call_user_func($options));
        }
        if (is_array($options)) {
            return $options;
        }
        return $options->toArray();
    }
231562
public function getCollection($db = null)
    {
        /* @var $modelClass ActiveRecord */
        $modelClass = $this->modelClass;
        if ($db === null) {
            $db = $modelClass::getDb();
        }
        if ($this->from === null) {
            $this->from = $modelClass::collectionName();
        }

        return $db->getFileCollection($this->from);
    }
899771
protected function getListCollection()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            return $this->collection->getList(array('limit' => $this->getLimit()));
        }

        if ($this->getParam('type')) {
            return $this->collection->getList(array('type' => $id, 'limit' => $this->getLimit()));
        }

        if (!is_numeric($id)) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        if ($this->getParam('store')) {
            return $this->collection->getList(array('store_id' => $id, 'limit' => $this->getLimit()));
        }

        $result = $this->collection->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }
106170
public function getCollections()
    {
        return $this->getCachedProperty(
            'collections',
            function () {
                $result = [];
                /** @var \DOMNodeList $items */
                // No REQUIRED — no exception.
                $items = $this->query('app:collection');
                foreach ($items as $item) {
                    $result[] = $this->getExtensions()->parseElement($this, $item);
                }

                return $result;
            }
        );
    }
659830
public function getGridParentOptions(): array
    {
        $columns[] = 'tl_content.type = ?';
        $columns[] = 'tl_content.pid = ?';
        $columns[] = 'tl_content.ptable = ?';

        $values[] = 'bs_gridStart';
        $values[] = CURRENT_ID;
        $values[] = $GLOBALS['TL_DCA']['tl_content']['config']['ptable'];

        $collection = $this->repository->findBy($columns, $values, ['tl_content.sorting']);
        $options    = [];

        if ($collection) {
            foreach ($collection as $model) {
                $options[$model->id] = sprintf(
                    '%s [%s]',
                    $model->bs_grid_name,
                    $model->getRelated('bs_grid')->title
                );
            }
        }

        return $options;
    }
603431
public function collect($result = null)
    {
        $result = $result ? $result : $this->getResult();

        if ($result->rowCount() > 0) {
            $collection = new Collection();
            foreach ($result->fetchAll(\PDO::FETCH_ASSOC) as $row) {
                $collection->add($row);
            }

            return $collection;
        }

        return null;
    }
1111526
public function values($collection=null) {
    list($collection) = self::_wrapArgs(func_get_args(), 1);
    
    return self::_wrap(array_values((array) $collection));
  }
1083848
public function all()
	{
		$callback = $this->connection->executeSelect($this->toSql(), ['12']);

		$start =   time() + microtime(true);

		$statement = $callback();

		$delay = time() + microtime(true) - $start;

		$items = $statement->fetchAll(PDO::FETCH_OBJ);

		$collection = new Collection($items, (count($items) > 0 ? array_keys((array)$items[0]) : []), $delay);

		return $collection;
	}
1206341
public function last()
    {
        $keys = AccessHelper::collectionKeys($this->data);

        if (empty($keys)) {
            return null;
        }

        $value = $this->data[end($keys)] ? $this->data[end($keys)] : null;

        return AccessHelper::isCollectionType($value) ? new static($value, $this->options) : $value;
    }
970764
public function listCollections($db = '')
    {
        $cursor = $this->cmd('listCollections', null, $db);
        $result = [];
        foreach ($cursor as $collection) {
            $result[] = $collection['name'];
        }
        return $result;
    }
829721
public function getLastRow()
    {
        if (!is_null($this->summaryRow)) {
            return $this->summaryRow;
        }

        if (count($this->rows) == 0) {
            return false;
        }

        return end($this->rows);
    }
717720
protected function getListCollectionItem()
    {
        $conditions = $this->query_filter;
        $conditions['limit'] = $this->data_limit;
        $conditions['collection_id'] = $this->data_collection['collection_id'];

        return $this->collection_item->getItems($conditions);
    }
1097369
public function getResults()
    {
        return ! is_null($this->farParent->{$this->localKey})
                ? $this->get()
                : $this->related->newCollection();
    }
1300571
protected function getListCollection()
    {
        $conditions = $this->query_filter;
        $conditions['limit'] = $this->data_limit;

        return (array) $this->collection->getList($conditions);
    }
715471
protected function getListCollectionItem()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            return $this->collection_item->getList(array('limit' => $this->getLimit()));
        }

        if (!is_numeric($id)) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        if ($this->getParam('collection')) {
            return $this->collection_item->getList(array('collection_id' => $id, 'limit' => $this->getLimit()));
        }

        $result = $this->collection_item->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }