Returns the collection representation to be stored and unschedules it afterwards.

@param bool $includeNestedCollections

@return array
505915
public function prepareAssociatedCollectionValue(PersistentCollectionInterface $coll, $includeNestedCollections = false)
    {
        $mapping  = $coll->getMapping();
        $pb       = $this;
        $callback = isset($mapping['embedded'])
            ? static function ($v) use ($pb, $mapping, $includeNestedCollections) {
                return $pb->prepareEmbeddedDocumentValue($mapping, $v, $includeNestedCollections);
            }
            : static function ($v) use ($pb, $mapping) {
                return $pb->prepareReferencedDocumentValue($mapping, $v);
            };

        $setData = $coll->map($callback)->toArray();
        if (CollectionHelper::isList($mapping['strategy'])) {
            $setData = array_values($setData);
        }

        $this->uow->unscheduleCollectionDeletion($coll);
        $this->uow->unscheduleCollectionUpdate($coll);

        return $setData;
    }
1262366
public function blockerIds(bool $collection = false)
    {
        $ids = $this->blockerUsers()->pluck($this->getTable().'.id');

        if ($collection) {
            return $ids;
        }

        return $ids->toArray();
    }
245543
public function excluding($excludes)
	{
		if($excludes === true)
		{
			$this->model->setIncludes([]);
		}
		else
		{
			$excludes = (array) $excludes;

			$includes = $this->model->getIncludes();

			foreach($excludes as $key => $relation)
			{
				if(is_string($relation) && isset($includes[$relation]))
				{
					unset($includes[$relation], $excludes[$key]); // Unset relations that may have been set with a criterion closure
				}
			}

			$this->model->setIncludes(array_udiff($includes, $excludes, function($a, $b)
			{
				return $a === $b ? 0 : -1;
			}));
		}

		return $this;
	}
924065
public function getSiblings(Node $node, $includeHiddenFromNav = true)
    {
        $this->init();
        $siblings = array();

        if (false !== $parent = $this->getParent($node)) {
            $siblings = $this->getChildren($parent, $includeHiddenFromNav);

            foreach ($siblings as $index => $child) {
                if ($child === $node) {
                    unset($siblings[$index]);
                }
            }
        }

        return $siblings;
    }
957988
public function desc(array $collection)
    {
        $this->changeDirection(false);
        $collection = $this->asc($collection);
        $this->changeDirection(true);
        return $collection;
    }
1001785
public function all(bool $includeDeprecated = false): array {
        $result = [];
        foreach ($this->iterate($includeDeprecated) as $key => $value) {
            $result[$key] = $value;
        }
        return $result;
    }
1012752
public function getSlotManagers($removeIncludedSlots = false)
    {
        return ( ! $removeIncludedSlots) ? $this->slotManagers : array_intersect_key($this->slotManagers, array_flip(array_keys($this->themeSlots->getSlots())));
    }
942707
public static function getNotDeleted($objects)
    {
        if (null === $objects) {
            return null;
        }

        if (!$objects instanceof Collection) {
            $objects = new ArrayCollection($objects);
        }

        foreach ($objects as $object) {
            $functionDeletedOld = [
                $object,
                "getDeleted"
            ];

            $functionDeletedNew = [
                $object,
                "isDeleted"
            ];

            if (true === is_callable($functionDeletedOld) && true === $object->getDeleted()) {
                $objects->removeElement($object);
            } elseif (true === is_callable($functionDeletedNew) && true === $object->isDeleted()) {
                $objects->removeElement($object);
            }
        }

        return $objects;
    }
945033
public function collection($collectionMethod = null)
    {
        $collection = collection($this->_loaded);
        if (is_callable($collectionMethod)) {
            return $collectionMethod($collection);
        }

        return $collection;
    }
1302468
public static function getUnassignedBlockTypes($includeInternalBlockTypes = false)
    {
        $result = [];
        $app = Application::getFacadeApplication();
        $db = $app->make(Connection::class);
        $rs = $db->executeQuery(<<<EOT
select BlockTypes.btID
from BlockTypes
left join BlockTypeSetBlockTypes on BlockTypes.btID = BlockTypeSetBlockTypes.btID
left join BlockTypeSets on BlockTypeSetBlockTypes.btsID = BlockTypeSets.btsID
where BlockTypeSets.btsID is null
order by BlockTypes.btDisplayOrder asc
EOT
        );
        while (($btID = $rs->fetchColumn()) !== false) {
            $bt = BlockType::getByID($btID);
            if ($bt !== null) {
                if ($includeInternalBlockTypes || !$bt->isBlockTypeInternal()) {
                    $result[] = $bt;
                }
            }
        }

        return $result;
    }
347568
public function getNodeTypes($includeAbstractNodeTypes = true)
    {
        if ($this->cachedNodeTypes === []) {
            $this->loadNodeTypes();
        }
        if ($includeAbstractNodeTypes) {
            return $this->cachedNodeTypes;
        }

        $nonAbstractNodeTypes = array_filter($this->cachedNodeTypes, function ($nodeType) {
            return !$nodeType->isAbstract();
        });

        return $nonAbstractNodeTypes;
    }
960060
public function transform($collection)
    {
        if (null === $collection) {
            return [];
        }

        // For cases when the collection getter returns $collection->toArray()
        // in order to prevent modifications of the returned collection
        if (\is_array($collection)) {
            return $collection;
        }

        if (!$collection instanceof Collection) {
            throw new TransformationFailedException('Expected a Doctrine\Common\Collections\Collection object.');
        }

        return $collection->toArray();
    }
363099
public function collections()
    {
        if (!$this->collections) {
            $this->collections = [];

            /** @var \record_adapter $record */
            foreach ($this as $record) {
                if (! isset($this->collections[$record->getBaseId()])) {
                    $this->collections[$record->getBaseId()] = $record->get_collection();
                }
            }

            $this->collections = array_values($this->collections);
        }

        return $this->collections;
    }
701210
public function getCollectionsUsedByPrivateFields()
    {
        $map = [];

        foreach ($this->private as $name => $field) {
            $map[$name] = $field->getDependantCollections();
        }

        return $map;
    }
44112
public function merge($collections = [])
    {
        $collections = func_get_args();

        array_unshift($collections, $this);
        foreach ($collections as &$collection) {
            $collection = (array) $collection;
        }
        unset($collection);

        $merged = call_user_func_array('array_merge', $collections);

        $collections = clone $this;
        $collections->exchangeArray($merged);

        return $collections;
    }
295534
public static function getScheduledAClassContentInsertions(EntityManager $em, $with_revision = false, $exclude_base_element = false)
    {
        $entities = array();
        foreach ($em->getUnitOfWork()->getScheduledEntityInsertions() as $entity) {
            if (false !== $tmp = self::getScheduledEntity($entity, $with_revision, $exclude_base_element)) {
                $entities[] = $tmp;
            }
        }

        return $entities;
    }
1226249
public function getCollectionsByStorage(StorageInterface $storage)
    {
        $this->initialize();

        $collections = [];
        foreach ($this->collections as $collectionName => $collection) {
            /** @var CollectionInterface $collection */
            if ($collection->getStorage() === $storage) {
                $collections[$collectionName] = $collection;
            }
        }
        return $collections;
    }