buildOneToManyPropertyAccessor example


    private function loadOneToManyWithPagination(
        EntityDefinition $definition,
        OneToManyAssociationField $association,
        Context $context,
        EntityCollection $collection,
        Criteria $fieldCriteria,
        array $partial
    ): void {
        $isPartial = $partial !== [];

        $propertyAccessor = $this->buildOneToManyPropertyAccessor($definition$association);

        // inject sorting for foreign key, otherwise the internal counter wouldn't work `order by customer_address.customer_id, other_sortings`         $sorting = array_merge(
            [new FieldSorting($propertyAccessor, FieldSorting::ASCENDING)],
            $fieldCriteria->getSorting()
        );

        $fieldCriteria->resetSorting();
        $fieldCriteria->addSorting(...$sorting);

        $ids = array_values($collection->getIds());

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