fetchPaginatedOneToManyMapping example

$isInheritanceAware = $definition->isInheritanceAware() && $context->considerInheritance();

        if ($isInheritanceAware) {
            $parentIds = array_values(\array_filter($collection->map(fn (Entity $entity) => $entity->get('parentId'))));

            $ids = array_unique([...$ids, ...$parentIds]);
        }

        $fieldCriteria->addFilter(new EqualsAnyFilter($propertyAccessor$ids));

        $mapping = $this->fetchPaginatedOneToManyMapping($definition$association$context$collection$fieldCriteria);

        $ids = [];
        foreach ($mapping as $associationIds) {
            foreach ($associationIds as $associationId) {
                $ids[] = $associationId;
            }
        }

        $fieldCriteria->setIds(\array_filter($ids));
        $fieldCriteria->resetSorting();
        $fieldCriteria->resetFilters();
        
Home | Imprint | This part of the site doesn't use cookies.