Initializes (loads) an uninitialized persistent collection of a document.

@param PersistentCollection $collection The collection to initialize.
8247
public function loadCollection(PersistentCollection $collection)
    {
        $this->getDocumentPersister(get_class($collection->getOwner()))->loadCollection($collection);
    }
1215327
public function merge($collection)
    {
        if (is_object($collection) && $collection->count() > 0) {
            $this->collection = array_merge($this->collection, $collection->collection);
        }
    }
21354
public function sync($collection)
    {
        foreach ($collection as $item) {
            $result = true;
            $websiteId = $item->getWebsiteId();
            if ($this->helper->isEnabled($websiteId)) {
                $this->client = $this->helper->getWebsiteApiClient($websiteId);
                $importData = $this->serializer->unserialize($item->getImportData());

                if ($this->client) {
                    $key = $importData[0];
                    $collectionName = $item->getImportType();
                    $this->client->deleteContactsTransactionalData($key, $collectionName);
                    $this->_handleSingleItemAfterSync($item, $result);
                }
            }
        }
    }
166227
public function loadCollection(PersistentCollection $collection)
    {
        $association = $collection->getMapping();
        $persister   = $this->getEntityPersister($association->getTargetEntity());

        if ($association instanceof OneToManyAssociationMetadata) {
            $persister->loadOneToManyCollection($association, $collection->getOwner(), $collection);
        } else {
            $persister->loadManyToManyCollection($association, $collection->getOwner(), $collection);
        }

        $collection->setInitialized(true);
    }
752825
public function loadCollection(PersistentCollectionInterface $collection) : void
    {
        if ($collection->getOwner() === null) {
            throw PersistentCollectionException::ownerRequiredToLoadCollection();
        }

        $this->getDocumentPersister(get_class($collection->getOwner()))->loadCollection($collection);
        $this->lifecycleEventManager->postCollectionLoad($collection);
    }
461105
public function addCollection(self $collection)
    {
        $this->renderDefinitions = \array_merge($this->renderDefinitions, $collection->all());
        $this->resources = \array_merge($this->resources, $collection->getResources());
    }
58594
protected function initializeCollection(BaseForm $form, SymfonyForm $collection, SymfonyForm $row = null)
    {
        $hash = $this->getFormStackHash($form, $collection);

        if (!isset($this->formCollectionStack[$hash])) {
            $this->formCollectionStack[$hash] = $collection->all();
        }

        if (!isset($this->formCollectionCount[$hash])) {
            $this->formCollectionCount[$hash] = [
                "count" => 0,
                "limit" => 0,
                "total_count" => count($this->formCollectionStack[$hash]),
            ];
        }

        return $hash;
    }
42536
public function createCollection($collection, $options = [])
    {
        if (is_array($collection)) {
            list($database, $collectionName) = $collection;
        } else {
            $database = null;
            $collectionName = $collection;
        }
        $this->beginProfile($token = "    > create collection " . $this->composeCollectionLogName($collection) . " ...");
        $this->db->getDatabase($database)->createCollection($collectionName, $options);
        $this->endProfile($token);
    }
21131
private function addManyReferences(PersistentCollectionInterface $persistentCollection, array &$groupedIds) : void
    {
        $mapping   = $persistentCollection->getMapping();
        $class     = null;
        $className = null;

        if ($mapping['storeAs'] === ClassMetadata::REFERENCE_STORE_AS_ID) {
            $className = $mapping['targetDocument'];
            $class     = $this->dm->getClassMetadata($className);
        }

        foreach ($persistentCollection->getMongoData() as $reference) {
            $id = ClassMetadata::getReferenceId($reference, $mapping['storeAs']);

            if ($mapping['storeAs'] !== ClassMetadata::REFERENCE_STORE_AS_ID) {
                $className = $this->uow->getClassNameForAssociation($mapping, $reference);
                $class     = $this->dm->getClassMetadata($className);
            }

            if ($class === null) {
                continue;
            }

            $document = $this->uow->tryGetById($id, $class);

            if ($document && ! (($document instanceof GhostObjectInterface && ! $document->isProxyInitialized()))) {
                continue;
            }

            $id                                     = $class->getPHPIdentifierValue($id);
            $groupedIds[$className][serialize($id)] = $id;
        }
    }
1347327
private function loadReferenceManyCollectionInverseSide(PersistentCollectionInterface $collection)
    {
        $query     = $this->createReferenceInverseSideQuery($collection->getMapping(), $collection->getOwner());
        $documents = $query->execute()->toArray();

        foreach ($documents as $key => $document) {
            $collection->add($document);
        }
    }
200244
protected function initialize()
    {
        $this->id = $this->formatId($this->column);
        $this->group = new Collection();
        $this->name = "{$this->id}-filter-group";

        $this->setupDefaultPresenter();
    }
675870
protected function initialize()
    {
        if (is_array($this->objectIdentifiers)) {
            foreach ($this->objectIdentifiers as $identifier) {
                try {
                    parent::attach($this->persistenceManager->getObjectByIdentifier($identifier));
                } catch (Exception\InvalidObjectDataException $exception) {
                    // when security query rewriting holds back an object here, we skip it...
                }
            }
            $this->objectIdentifiers = null;
        }
    }
171698
private function AddCollectionToConfig($collection)
	{
		foreach($collection as $key=>$value)
		{
			if ($key[0] == '/')
				$this->_virtualCommand = str_replace('_', '.', substr($key, 1));
			$this->addPairToConfig($key, $value);
		}
	}
586603
public function addCollection(self $collection)
    {
        $this->requirements = array_merge($this->requirements, $collection->all());
    }
889162
public function hasCollection($collection)
    {
        if (empty($this->queriesResultCache[ 'collectionNames' ])) {
            $this->getCollections();
        }

        return (bool)in_array($collection, $this->queriesResultCache[ 'collectionNames' ]);
    }
521879
public void setCollection(String collection) {
        addField(ConfigureNodeFields.collection, FormField.Type.text_single);
        setAnswer(ConfigureNodeFields.collection.getFieldName(), collection);
    }
833499
public function collections(array $collections) : void {
        foreach ($collections as $name => $callback) {
            $this->make($name, $callback);
        }
    }