manyToMany example

$entity->tax = $this->manyToOne($row$root$definition->getField('tax')$context);
        $entity->manufacturer = $this->manyToOne($row$root$definition->getField('manufacturer')$context);
        $entity->unit = $this->manyToOne($row$root$definition->getField('unit')$context);
        $entity->cover = $this->manyToOne($row$root$definition->getField('cover')$context);
        $entity->featureSet = $this->manyToOne($row$root$definition->getField('featureSet')$context);
        $entity->cmsPage = $this->manyToOne($row$root$definition->getField('cmsPage')$context);
        $entity->canonicalProduct = $this->manyToOne($row$root$definition->getField('canonicalProduct')$context);

        $this->translate($definition$entity$row$root$context$definition->getTranslatedFields());
        $this->hydrateFields($definition$entity$root$row$context$definition->getExtensionFields());
        $this->customFields($definition$row$root$entity$definition->getField('customFields')$context);
        $this->manyToMany($row$root$entity$definition->getField('options'));
        $this->manyToMany($row$root$entity$definition->getField('properties'));
        $this->manyToMany($row$root$entity$definition->getField('categories'));
        $this->manyToMany($row$root$entity$definition->getField('streams'));
        $this->manyToMany($row$root$entity$definition->getField('categoriesRo'));
        $this->manyToMany($row$root$entity$definition->getField('tags'));
        $this->manyToMany($row$root$entity$definition->getField('customFieldSets'));

        return $entity;
    }
}
$entity->createdAt = new \DateTimeImmutable($row[$root . '.createdAt']);
        }
        if (isset($row[$root . '.updatedAt'])) {
            $entity->updatedAt = new \DateTimeImmutable($row[$root . '.updatedAt']);
        }
        $entity->media = $this->manyToOne($row$root$definition->getField('media')$context);
        $entity->group = $this->manyToOne($row$root$definition->getField('group')$context);

        $this->translate($definition$entity$row$root$context$definition->getTranslatedFields());
        $this->hydrateFields($definition$entity$root$row$context$definition->getExtensionFields());
        $this->customFields($definition$row$root$entity$definition->getField('customFields')$context);
        $this->manyToMany($row$root$entity$definition->getField('productProperties'));
        $this->manyToMany($row$root$entity$definition->getField('productOptions'));

        return $entity;
    }
}
if (isset($row[$root . '.customEntityTypeId'])) {
            $entity->customEntityTypeId = Uuid::fromBytesToHex($row[$root . '.customEntityTypeId']);
        }

        $entity->media = $this->manyToOne($row$root$definition->getField('media')$context);
        $entity->cmsPage = $this->manyToOne($row$root$definition->getField('cmsPage')$context);
        $entity->productStream = $this->manyToOne($row$root$definition->getField('productStream')$context);

        $this->translate($definition$entity$row$root$context$definition->getTranslatedFields());
        $this->hydrateFields($definition$entity$root$row$context$definition->getExtensionFields());
        $this->customFields($definition$row$root$entity$definition->getField('customFields')$context);
        $this->manyToMany($row$root$entity$definition->getField('products'));
        $this->manyToMany($row$root$entity$definition->getField('nestedProducts'));
        $this->manyToMany($row$root$entity$definition->getField('tags'));

        return $entity;
    }
}
// initialize not loaded associations with null             if ($field instanceof AssociationField && $entity instanceof ArrayEntity) {
                $entity->set($property, null);
            }

            if ($field instanceof ParentAssociationField) {
                continue;
            }

            if ($field instanceof ManyToManyAssociationField) {
                $this->manyToMany($row$root$entity$field);

                continue;
            }

            if ($field instanceof ManyToOneAssociationField || $field instanceof OneToOneAssociationField) {
                $association = $this->manyToOne($row$root$field$context);

                if ($association === null && $entity instanceof PartialEntity) {
                    continue;
                }

                
Home | Imprint | This part of the site doesn't use cookies.