Get all available entity descriptor

@return EntityDescriptor[]
518382
public static function getAllEntityDescriptors() {
		$entities = array();
		foreach( static::getAllEntities() as $entity ) {
			$entities[$entity] = EntityDescriptor::load($entity);
		}
		return $entities;
	}
234714
protected function findOrphanedIds(): array
    {
        $queryBuilder = $this->entityManager->createQueryBuilder();
        $queryBuilder->select('i.id AS id')
                     ->from(Item::class, 'i')
                     ->leftJoin('i.modCombinations', 'mc')
                     ->leftJoin(RecipeIngredient::class, 'ri', 'WITH', 'ri.item = i.id')
                     ->leftJoin(RecipeProduct::class, 'rp', 'WITH', 'rp.item = i.id')
                     ->andWhere('mc.id IS NULL')
                     ->andWhere('ri.item IS NULL')
                     ->andWhere('rp.item IS NULL');

        $result = [];
        foreach ($queryBuilder->getQuery()->getResult() as $data) {
            $result[] = (int) $data['id'];
        }
        return $result;
    }
831674
public function getDefAsArray()
    {
        return array_replace(
            parent::getDefAsArray(),
            [
                'type'              => $this->getType(),
                'doctrineType'      => $this->getTypeDoctrine(),
                'serializerType'    => $this->getTypeSerializer(),
                'relType'           => $this->relation === null ? self::REL_TYPE_REF : $this->relation->getType(),
                'isClassType'       => true,
            ]
        );
    }
1352247
public function getRows(EntityDescriptor $ed) {
		$r = array();
		foreach( $ed->getFieldsName() as $field ) {
			$r += $this->getErrorsForField($ed, $field);
		}
		return array_unique($r);
	}
1086243
public function getFilterFieldDescriptors()
    {
        $fieldDescriptors = [];

        $fieldDescriptors['type_id'] = new DoctrineFieldDescriptor(
            'id',
            'type_id',
            self::$productTypeEntityName,
            null,
            [
                self::$productTypeEntityName => new DoctrineJoinDescriptor(
                    self::$productTypeEntityName,
                    static::$productEntityName . '.type'
                ),
            ]
        );

        $fieldDescriptors['status_id'] = new DoctrineFieldDescriptor(
            'id',
            'status_id',
            self::$productStatusEntityName,
            null,
            [
                self::$productStatusEntityName => new DoctrineJoinDescriptor(
                    self::$productStatusEntityName,
                    static::$productEntityName . '.status'
                ),
            ]
        );

        $fieldDescriptors['accounts_supplier_id'] = new DoctrineFieldDescriptor(
            'id',
            'supplier_id',
            self::$accountsSupplierEntityName,
            null,
            [
                self::$accountsSupplierEntityName => new DoctrineJoinDescriptor(
                    self::$accountsSupplierEntityName,
                    static::$productEntityName . '.supplier'
                ),
            ]
        );

        $fieldDescriptors['is_deprecated'] = new DoctrineFieldDescriptor(
            'isDeprecated',
            'is_deprecated',
            static::$productEntityName,
            null,
            []
        );

        $fieldDescriptors['parent'] = new DoctrineFieldDescriptor(
            'id',
            'parent',
            static::$productEntityName . 'Parent',
            'product.parent',
            [
                static::$productEntityName . 'Parent' => new DoctrineJoinDescriptor(
                    static::$productEntityName,
                    static::$productEntityName . '.parent'
                ),
            ],
            true
        );

        $fieldDescriptors['categories'] = new DoctrineFieldDescriptor(
            'id',
            'categories',
            static::$productEntityName . 'Categories',
            'products.categories',
            [
                static::$productEntityName . 'Categories' => new DoctrineJoinDescriptor(
                    static::$productEntityName,
                    static::$productEntityName . '.categories'
                ),
            ],
            true
        );

        $fieldDescriptors['attributes'] = new DoctrineFieldDescriptor(
            'id',
            'attributes',
            static::$productEntityName . 'ProductAttributes',
            'products.product-attributes',
            [
                static::$productEntityName . 'ProductAttributes' => new DoctrineJoinDescriptor(
                    static::$productEntityName,
                    static::$productEntityName . '.productAttributes'
                ),
            ],
            true
        );

        return $fieldDescriptors;
    }
291478
protected function getEntitiesDescriptor()
    {
        $ret = new EntitiesDescriptor();
        $now = time();

        // add RegistrationInfo extension if enabled
        if (!empty($this->regInfo)) {
            $ri = new RegistrationInfo();
            $ri->registrationInstant = $now;
            foreach ($this->regInfo as $riName => $riValues) {
                switch ($riName) {
                    case 'authority':
                        $ri->registrationAuthority = $riValues;
                        break;
                    case 'instant':
                        $ri->registrationInstant = Utils::xsDateTimeToTimestamp($riValues);
                        break;
                    case 'policies':
                        $ri->RegistrationPolicy = $riValues;
                        break;
                }
            }
            $ret->Extensions[] = $ri;
        }

        foreach ($this->sources as $source) {
            $m = $source->getMetadata();
            if ($m === NULL) {
                continue;
            }
            if ($m instanceof EntityDescriptor) {
                $ret->children[] = $m;
            } elseif ($m instanceof EntitiesDescriptor) {
                $ret->children = array_merge($ret->children, self::extractEntityDescriptors($m));
            }
        }

        $ret->children = array_unique($ret->children, SORT_REGULAR);
        $ret->validUntil = $now + $this->validLength;

        return $ret;
    }
880068
public function getEntityOptions(): array
    {
        if (isset($this->existingEntities)) {
            return $this->existingEntities;
        }
        /** @var ClassMetadata[] $entityMetadata */
        $entityMetadata = $this->classMetadataFactory->getAllMetadata();

        $entities = [];
        foreach ($entityMetadata as $meta) {
            $entities[] = $this->createByClassName($meta->getName());
        }
        return $this->existingEntities = $entities;
    }
498175
public function findExpiredIdentifiers(): array
    {
        $queryBuilder = $this->createQuery();
        $rows = $queryBuilder->select('identifier')
            ->from($this->getTableName())
            ->where($queryBuilder->expr()->lt(
                'expires',
                $queryBuilder->createNamedParameter((new DateTimeService())->getCurrentTime(), \PDO::PARAM_INT)
            ))
            ->groupBy('identifier')
            ->execute()
            ->fetchAll();

        $cacheIdentifiers = [];
        foreach ($rows as $row) {
            $cacheIdentifiers[] = $row['identifier'];
        }

        return $cacheIdentifiers;
    }
760815
public function getMembershipTypes() {
    $types = [];
    $membership_ids = $this->queryFactory->get('node')
      ->condition('type', 'membership')
      ->condition('status', 1)
      ->execute();

    if (!$membership_ids) {
      return $types;
    }

    $storage = $this->entityTypeManager->getStorage('node');
    $builder = $this->entityTypeManager->getViewBuilder('node');
    $memberships = $storage->loadMultiple($membership_ids);

    foreach ($memberships as $membership) {
      $membership_id = $membership->id();
      $types[$membership_id] = [
        'title' => $membership->title->value,
        'description' => $builder->view($membership, 'calc_preview'),
      ];
    }

    return $types;
  }
323279
protected function getContentEntityTypes() {
    $options = [];
    foreach ($this->entityTypeManager->getDefinitions() as $entity_type) {
      if ($entity_type instanceof ContentEntityTypeInterface) {
        $options[$entity_type->id()] = $entity_type->getLabel();
      }
    }
    return $options;
  }
1080199
public function getAll() 
    {
        return [
            self::ENTRY_ID         => $this->getId(),
            self::ENTRY_NAME       => $this->getName(),
            self::ENTRY_TYPE       => $this->getType(),
        ];
    }
1051864
protected function getManagedProperties(): array
    {
        $properties = $this->entityMap->getProperties();

        $attributesName = $this->entityMap->getAttributesArrayName();

        return $attributesName == null ? $properties : array_merge($properties, [$attributesName]);
    }
1103740
public function getIds(): iterable
    {
        $this->checkRepository();

        $primaryKey  = $this->getClassMetadata()->getSingleIdentifierFieldName();

        $result = $this->_em
            ->createQueryBuilder()
            ->select('entity.'.$primaryKey)
            ->from($this->_entityName, 'entity')
            ->getQuery()
            ->getResult(Query::HYDRATE_ARRAY)
        ;

        $array = [];

        foreach ($result as $id) {
            $array[] = $id[$primaryKey];
        }

        return $array;
    }
861980
public function getAllRootIds()
    {
        $entityClass = $this->getEntityClass();

        $query  = $this->getObjectManager()->createQuery('SELECT DISTINCT c.root FROM ' . $entityClass . ' c');
        $result = $query->getResult();

        $rootIds = array();
        foreach ($result as $resultArray) {
            $rootIds[] = $resultArray['root'];
        }

        return $rootIds;
    }
664107
protected function getUsedClasses()
    {
        $uses = array();
        if ($orm = $this->getOrmUse()) {
            $uses[] = $orm;
        }
        if (count($this->getTableM2MRelations()) || count($this->getAllLocalForeignKeys())) {
            $uses[] = $this->getCollectionClass();
        }

        return $uses;
    }
1099047
public function getAllIds(): array
    {
        $result = [];
        foreach ($this->getExported() as $entity) {
            $result[$entity->getId()] = $entity;

            foreach ($entity->getExportChildren() as $child) {
                $result[$child->getId()] = $child;
            }
        }
        return array_keys($result);
    }
1158517
public function getUseReferences($entityType = null)
    {
        if (is_null($entityType)) {

            return $this->useReferences;
        }

        if (isset($this->useReferences[$entityType])) {

            return $this->useReferences[$entityType];
        }

        return array();
    }