Nextras\Orm\Relationships\ManyHasMany::createCollection PHP Метод

createCollection() защищенный Метод

protected createCollection ( )
    protected function createCollection()
    {
        if ($this->metadata->relationship->isMain) {
            $mapperOne = $this->parent->getRepository()->getMapper();
            $mapperTwo = $this->getTargetRepository()->getMapper();
        } else {
            $mapperOne = $this->getTargetRepository()->getMapper();
            $mapperTwo = $this->parent->getRepository()->getMapper();
        }
        $collection = $mapperOne->createCollectionManyHasMany($mapperTwo, $this->metadata, $this->parent);
        return $this->applyDefaultOrder($collection);
    }