@VirtualProperty
@SerializedName("items")
@Groups({"Default","cart"})

@return \Doctrine\Common\Collections\Collection
559341
public function getItems()
    {
        if (!$this->itemsChanged && $this->cacheItems && count($this->cacheItems) === count($this->entity->getItems())) {
            return $this->cacheItems;
        } else {
            $this->itemsChanged = false;
            $this->cacheItems = array();
            foreach ($this->entity->getItems() as $item) {
                $this->cacheItems[] = $this->itemFactory->createApiEntity($item, $this->locale, $this->getCurrencyCode());
            }
        }

        return $this->cacheItems;
    }
179054
public function toRefArray()
    {
        // Retrieve the actual objects.
        $documents = $this->toArray();

        // Get the collection idenfitier
        $collection = (string) $this->collection->getCollection();

        foreach ($documents as &$document) {
            $document = MongoDBRef::create($collection, $document);
        }

        return $documents;
    }
450900
public function getItems()
    {
        if (null === $this->items) {
            /** @var \Darvin\AdminBundle\Menu\Item[] $items */
            $items = $skipped = [];

            foreach ($this->itemFactories as $itemFactory) {
                foreach ($itemFactory->getItems() as $item) {
                    if (isset($items[$item->getName()])) {
                        throw new MenuException(sprintf('Menu item "%s" already exists.', $item->getName()));
                    }
                    if (null === $item->getIndexUrl() && null === $item->getNewUrl()) {
                        $skipped[$item->getName()] = true;

                        continue;
                    }

                    $associatedObject = $item->getAssociatedObject();

                    if (!empty($associatedObject)
                        && (!$this->authorizationChecker->isGranted(Permission::VIEW, $associatedObject) && !$this->authorizationChecker->isGranted(Permission::CREATE_DELETE, $associatedObject))
                    ) {
                        $skipped[$item->getName()] = true;

                        continue;
                    }

                    $items[$item->getName()] = $item;
                }
            }

            $this->sortItems($items);

            foreach ($items as $item) {
                if (!$item->hasParent()) {
                    continue;
                }

                $parentName = $item->getParentName();

                if (isset($skipped[$parentName])) {
                    continue;
                }
                if (!isset($items[$parentName])) {
                    $items[$parentName] = $this->createItemGroup($parentName, $item->getPosition());
                }

                $parent = $items[$parentName];
                $parent->addChild($item);
            }
            foreach ($items as $key => $item) {
                if ($item->hasParent() && !isset($skipped[$item->getParentName()])) {
                    unset($items[$key]);
                }
            }

            $this->sortItems($items);

            $this->items = $items;
        }

        return $this->items;
    }
451
public function unique() : Collection
    {
        $acc = [];
        foreach ($this->list as $item) {
            if (!in_array($item, $acc)) {
                $acc[] = $item;
            }
        }

        return self::from(...$acc);
    }
786555
public function getItems()
	{
		/**
		 * @var array $res
		 */
		$res = array();
		foreach ( $this->iter as /** @var XPathItem $item */ $item )
		{
			if ( count( $res ) == 10)
				break;

			$res[] = $item->CloneInstance();
		}

		return $res;
	}
146145
public function getManagedEntities()
    {
        $entities = array();
        /** @var \Symfony\Component\HttpKernel\Bundle\BundleInterface $bundle */
        foreach ($this->kernel->getBundles() as $bundle) {
            $entityPath = $bundle->getPath() . '/Entity';
            if (is_dir($entityPath)) {
                $iter = new \RegexIterator(
                    new \RecursiveIteratorIterator(
                        new \RecursiveDirectoryIterator($entityPath)
                    ),
                    '/\.php$/'
                );

                foreach ($iter as $file) {
                    $entityName = substr(
                        ltrim(str_replace(realpath($entityPath), '', realpath($file->getPathname())), '/'),
                        0,
                        -4
                    );

                    $alias = Str::classname(get_class($bundle)) . ':' . str_replace('/', '\\', $entityName);
                    try {
                        $repos = $this->doctrine->getRepository($alias);

                        $className     = $repos->getClassName();
                        $classMetaData = $this->metadata->getMetadataForClass($className);
                        foreach ($classMetaData->propertyMetadata as $property => $metadata) {
                            if (isset($metadata->fileManager)) {
                                $entities[] = $alias;
                                break;
                            }
                        }
                    } catch (\Exception $e) {
                    }
                }
            }
        }

        return $entities;
    }
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;
    }
643465
function copy()
    {
        $collection = clone $this;

        $db = eZDB::instance();
        $db->begin();
        $collection->store();

        $oldItems = $this->itemList();
        foreach ( $oldItems as $oldItem )
        {
            $item = $oldItem->copy( $collection->attribute( 'id' ) );
        }
        $db->commit();
        return $collection;
    }
424028
public function getItems()
    {
        if ($this->_items !== null) {
            return $this->_items;
        }
        
        $data = [];
        foreach ($this->getModules() as $node) {
            foreach (ArrayHelper::getValue($this->getModuleItems($node['id']), 'groups', []) as $groupValue) {
                foreach ($groupValue['items'] as $array) {
                    $array['module'] = $node;
                    $data[] = $array;
                }
            }
        }

        $this->_items = $data;
        
        return $data;
    }
1186902
private function &getCollection()
    {
        if (null === $this->collection) {
            $qb = $this->createAndFilterQueryBuilder($this->getEntityAlias());
            if ($this->isHydrationDisabled()) {
                $this->collection = $qb->getQuery()->getScalarResult();
            } else {
                $this->collection = $qb->getQuery()->getResult();
            }
        }
        return $this->collection;
    }
516939
public function collection(Collection $collection)
    {
        $entries = new Entries();

        foreach ($collection as $product) {
            $entry = new Entry($product);

            $entry
                ->field('id')
                ->field('name')
                ->field('description')
                ->field('sku')
                ->field('status')
                ->field('price')
                ->field('sale_price')
                ->field('quantity')

                ->value('image', $product->product->defaultImage())
                // ->relationshipField('product', 'Subbly\\Presenter\\V1\\ProductPresenter')

                ->dateField('created_at')
                ->dateField('updated_at')
            ;

            $entries->addEntry($entry);
        }

        return $entries->toArray();
    }
684161
protected function _collection()
    {
        if (!isset($this->_collections[$this->_collection])) {
            $this->_collections[$this->_collection] = new $this->_collectionClass($this);
        }

        return $this->_collections[$this->_collection];
    }
1252140
public function get_flat_items() {
		$flat_items = array();

		foreach ( $this->items as $priority => $items ) {
			$flat_items = array_merge( $flat_items, $items );
		}

		return $flat_items;
	}
1010615
protected function getMongoCollection()
    {
        if (!isset($this->collection)) {
            $config = \Tripod\Config::getInstance();

            $this->collection = $config->getCollectionForJobGroups($this->storeName);
        }
        return $this->collection;
    }
1259879
public function getCollection()
    {
        if (!$this->collection) {
            // gridfs
            if ($this->isFile) {
                $this->collection = $this->getConnection()->getMongoDB()->getGridFS($this->collectionName);
            // normal
            } else {
                $this->collection = $this->getConnection()->getMongoDB()->selectCollection($this->collectionName);
            }
        }

        return $this->collection;
    }
484128
public function findVirtual()
    {
        $results = [];
        foreach ($this->columns as $name => $column) {
            if ($column->isVirtual()) {
                $results[] = $name;
            }
        }

        return new Result($results, $this->columns);
    }
662171
public function &GetFieldShopBundleArticleList()
    {
        $oBundleList = parent::GetFieldShopBundleArticleList();
        if (0 == $oBundleList->Length() && $this->IsVariant()) {
            $oBundleList = $this->GetFieldVariantParent()->GetFieldShopBundleArticleList();
        }
        $oBundleList->bAllowItemCache = true;

        return $oBundleList;
    }