@param string $ref_name

@return \Interpro\Extractor\Contracts\Collections\GroupsCollectionSet
968504
public function getCollectionSet($ref_name)
    {
        if(!in_array($ref_name, $this->item_names))
        {
            $this->notFoundAction($ref_name);
        }

        if(!array_key_exists($ref_name, $this->items))
        {
            $this->items[$ref_name] = $this->collectionFactory->createCollectionSet($this->ref, $ref_name);
        }

        return $this->items[$ref_name];
    }
1306142
protected function findSegmentForReference($name, AbstractSegment $reference)
    {
        $segments = $this->findSegments($name);
        foreach ($segments as $seg) {
            $segSplit = $this->splitSegment($seg);
            $segSplit = array_shift($segSplit);
            $segSplit = $this->splitDeg($segSplit);
            if ($segSplit[3] == $reference->getSegmentNumber()) {
                return $seg;
            }
        }

        return null;
    }
1285985
public static function instances(): BaseCollection
    {
        $instances = new BaseCollection;

        foreach (static::make()->all() as $key => $value) {
            if ($instance = self::instance($key)) {
                $instances->put($key, $instance);
            }
        }

        return $instances;
    }
411792
public function refSQL($name, $load = null)
    {
        /** @type Field_Reference $ref */
        $ref = $this->getElement($name);

        return $ref->refSQL($load);
    }
582208
public function getAll($collection_name, $query = array()) {		
        if(!is_array($query)) {
            throw new \Exception("\$query must be an associative array of 'field => value' pairs");
        }

        $collection = new Collection($collection_name, true, $this);
				
        return $collection->find($query);
    }
14930
public function group ($collection_name, $keys , array $initial , $reduce, array $condition = array())
    {
        return $this->_call(
            'group', array(
                'collection_name' => $collection_name,
                'keys'            => $keys,
                'initial'         => $initial,
                'reduce'          => $reduce,
                'condition'       => $condition
            )
        );
    }
370445
public function selectCollection($name, array $options = [])
    {
        if (!isset($this->collections[$name])) {
            $this->createCollection($name);
        }
        return $this->collections[$name]['collection'];
    }
416988
protected function normalizeCollection($collection, $name, $format = null, array $context = array())
    {
        if (empty($collection)) {
            return array();
        }

        if ($collection instanceof AbstractLazyCollection and !$collection->isInitialized()) {
            return array();
        }

        $data = array();
        foreach ($collection as $key => $element) {
            $data[$key] = $this->normalizeAssociation($element, $name, $format, $context);
        }

        return $data;
    }
117625
public static function ref($ref)
    {
        if (isset($ref['$id'])) {
            if ($ref['$ref'] == self::collectionName()) {
                return self::id($ref['$id']);
            }
        }

        return null;
    }
1346014
private function getValue($ref, $name, $default = null)
    {
        $refName = \is_object($ref) ? ClassLookup::getClass($ref) : $ref;

        if (isset($this->configuration[$refName][$name])) {
            return $this->configuration[$refName][$name];
        }

        if (false === \is_callable($default)) {
            return $default;
        }

        $page = \is_string($ref) ? new $refName() : $ref;
        $result = $default($page);
        unset($page);

        $this->configuration[$refName][$name] = $result;

        return $result;
    }
115904
public function &__get($name)
    {
        // This method must return a reference and not use ternary operators for __set()ing multi-dimensional arrays
        // http://stackoverflow.com/questions/4310473/using-set-with-arrays-solved-but-why
        // http://stackoverflow.com/questions/5966918/return-null-by-reference-via-get
        switch ($name) {
            case 'global':
                if (is_null(static::$global)) {
                    static::$global = new Container;
                }

                return static::$global;
                break;
            case 'session':
                if (is_null(static::$session)) {
                    static::$session = new Session;
                }

                return static::$session;
                break;
            case 'request':
            case 'dir':
            case 'url':
            case 'html':
                return $this->$name;
                break;
            default:
                return $this->html[strtolower($name)];
                break;
        }
    }
180079
public function getCollection($name, $refresh = false)
    {
        if ($refresh || !array_key_exists($name, $this->_collections)) {
            $this->_collections[$name] = $this->selectCollection($name);
        }

        return $this->_collections[$name];
    }
1305316
public function selectCollection($name)
    {
        if ($this->eventManager->hasListeners(Events::preSelectCollection)) {
            $this->eventManager->dispatchEvent(Events::preSelectCollection, new EventArgs($this, $name));
        }

        $collection = $this->doSelectCollection($name);

        if ($this->eventManager->hasListeners(Events::postSelectCollection)) {
            $this->eventManager->dispatchEvent(Events::postSelectCollection, new EventArgs($this, $collection));
        }

        return $collection;
    }
1037070
public function getGroupCustom($group_name, $ref_name, $selection_name = 'group')
    {
        return $this->subVars->getCollectionSet($ref_name)->getGroup($group_name, $selection_name);
    }
352025
public static function getReference($name) {
        if (isset(self::$customer_references[$name])) {
            return self::$customer_references[$name];
        } else {
            return null;
        }
    }
546923
public function getCollection($collection, $transformer = null, $resourceKey = null)
    {
        $resource = new FractalCollection(
            $collection,
            $this->getTransformer($transformer),
            $this->getResourceKey($resourceKey)
        );

        if ($meta = $this->getMeta()) {
            $resource->setMeta($meta);
            $this->meta = [];
        }

        return $this->fractal->createData($resource)->toArray();
    }
761314
public function get_order_master_collections()
    {
        $baseIds = $this->getOrderMasterCollectionsBaseIds();

        $collectionReferences = $this->app['repo.collection-references']->findHavingOrderMaster($baseIds);
        $groups = new CollectionReferenceCollection($collectionReferences);

        $collections = [];

        foreach ($groups->groupByDataboxIdAndCollectionId() as $databoxId => $group) {
            foreach ($group as $collectionId => $index) {
                $collections[$index] = \collection::getByCollectionId($this->app, $databoxId, $collectionId);
            }
        }

        ksort($collections);

        return $collections;
    }