splitResultsByOperation example

continue;
                }
                $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 {
                    
Home | Imprint | This part of the site doesn't use cookies.