addParentResults example

$writeResults[$entity][] = new EntityWriteResult($primaryKey[]$entity, EntityWriteResult::OPERATION_UPDATE);
            }
        }

        return $writeResults;
    }

    public function addDeleteResults(array $identifiers, array $notFound, array $parents): WriteResult
    {
        $results = $this->splitResultsByOperation($identifiers);

        $deleted = $this->addParentResults($results['deleted']$parents);

        $mapped = [];
        $updates = [];
        foreach ($deleted as $entity => $nested) {
            /** @var EntityWriteResult $result */
            foreach ($nested as $result) {
                if ($result->getOperation() === EntityWriteResult::OPERATION_UPDATE) {
                    $updates[$entity][] = $result;
                } else {
                    $mapped[$entity][] = $result;
                }
            }
$this->gateway->execute($commandQueue->getCommandsInOrder()$context);

        $result = $this->factory->build($commandQueue);

        $notFound = array_merge_recursive(...$notFound);

        $writes = array_merge_recursive(...$writes);

        $deletes = array_merge_recursive(...$deletes);

        $result = $this->factory->addParentResults($result$writes);

        $result = $this->factory->addDeleteResults($result$notFound$deletes);

        return $result;
    }

    /** * @param array<mixed> $rawData * * @return array<mixed> */
    
Home | Imprint | This part of the site doesn't use cookies.