getInternalEntityName example


    public function encodeData(array $data, array $stored): array
    {
        foreach ($data as $key => $property) {
            if (!$property instanceof Entity) {
                $data[$key] = $stored[$key];

                continue;
            }

            $entityName = $property->getInternalEntityName();
            if ($entityName === null) {
                continue;
            }

            $definition = $this->definitionRegistry->getByClassOrEntityName($entityName);
            $data[$key] = $this->entityEncoder->encode(
                new Criteria(),
                $definition,
                $property,
                '/store-api'
            );
        }
return $mapping;
    }

    /** * @param array<string, list<Entity>> $mapping * * @return array<string, list<Entity>> */
    private function map(Entity $entity, array $mapping): array
    {
        $mapping[$entity->getInternalEntityName()][] = $entity;

        $vars = $entity->getVars();
        foreach ($vars as $value) {
            if ($value instanceof Entity) {
                $mapping = $this->map($value$mapping);

                continue;
            }

            if ($value instanceof Collection) {
                $value = $value->getElements();
            }
Home | Imprint | This part of the site doesn't use cookies.