Get related collections to current collection
@return ArrayObject
975541
public function related()
    {
        $collections = self::get("/collections/{$this->id}/related");
        $collectionsArray = self::getArray($collections->getBody(), get_called_class());
        return new ArrayObject($collectionsArray, $collections->getHeaders());
    }
516828
public function getCollections()
    {
        if ($this->collections) {
            return $this->collections;
        }

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

        return $this->collections = $collectionMapper->find();
    }
588176
public function toDictionary()
    {
        return $this->pairs()->reduce(function (Collection $pairs, LineInterface $line) {
            $pairs[ $line->key() ] = $line->value();

            return $pairs;
        }, new Collection);
    }
728325
public function getFilterCollection()
    {
        if (null === $this->filterCollection) {
            $this->filterCollection = new Filter\FilterCollection($this);
        }

        return $this->filterCollection;
    }
560841
public function getResults()
    {
        return ! is_null($this->getParentKey())
                ? $this->query->get()
                : $this->related->newCollection();
    }
419178
public function collection()
    {
        if (!empty($this->response['data'])) {
            $data = [];

            foreach ($this->response['data'] as $object) {
                $data[] = new Fluent($this->resource, $object);
            }

            return $data;
        }

        return [];
    }
958285
public function getActiveCages() : Collection
    {
        if ($this->activeCagesCollection !== null) {
            return $this->activeCagesCollection;
        }

        $this->activeCagesCollection = new Collection();

        foreach ($this->allCages as $id => $cage) {
            if (!$cage->isExpired() && !$cage->isRemoved()) {
                $this->activeCagesCollection->push($cage);
            }
        }

        return $this->activeCagesCollection;
    }
315682
public function getAll()
    {
        if (isset($this->collection[$this->id])) {
            return $this->collection[$this->id];
        }

        return array();
    }
315891
public function all()
    {
        $this->prepFetch();

        $result = $this->oosql_stmt->fetchAll();

        $collection = new collection();

        $collection->addBulk($result);

        $collection->obj_name = $this->oosql_class;

        self::$oosql_result = clone $collection;

        return $collection;
    }
1097369
public function getResults()
    {
        return ! is_null($this->farParent->{$this->localKey})
                ? $this->get()
                : $this->related->newCollection();
    }
915421
public function getCollection($collectionClass = CreateFromAttributesInterface::class)
    {
        $collection = [];
        if ($this->isSuccessful()) {
            $data = $this->getData();
            foreach ($data as $attributes) {
                /** @var AbstractModel $collectionClass */
                $collection[] = $collectionClass::createFromAttributes($attributes);
            }
        }

        return $collection;
    }
1300571
protected function getListCollection()
    {
        $conditions = $this->query_filter;
        $conditions['limit'] = $this->data_limit;

        return (array) $this->collection->getList($conditions);
    }
852303
protected function collects()
    {
        if ($this->collects) {
            return $this->collects;
        }

        if (Str::endsWith(class_basename($this), 'Collection') &&
            class_exists($class = Str::replaceLast('Collection', '', get_class($this)))) {
            return $class;
        }
    }
296837
protected function getCollectionFromObjectByValue()
    {
        $object = $this->getObject();
        $getter = 'get' . ucfirst($this->getCollectionName());

        if (!method_exists($object, $getter)) {
            throw new InvalidArgumentException(
                sprintf(
                    'The getter %s to access collection %s in object %s does not exist',
                    $getter,
                    $this->getCollectionName(),
                    get_class($object)
                )
            );
        }

        return $object->$getter();
    }
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);
    }
314582
public function getChildren()
    {
        $children = new ArrayCollection();
        if ($this->reference) {
            $children->add($this->reference);
        }

        return $children;
    }
324520
public function getAll()
	{
		$collection = new Collection;

		$keys = $this->database->keys($this->namespace.':*');

		foreach ($keys as $key)
		{
			list($namespace, $name) = explode(':', $key);

			if ( ! $collection->has($name))
			{
				$collection->put($name, $this->get($name));
			}
		}

		return $collection;
	}