executeWrites example

// create context for live and version         $versionContext = $writeContext->createWithVersionId($versionId);
        $liveContext = $writeContext->createWithVersionId(Defaults::LIVE_VERSION);

        $versionContext->addState(self::MERGE_SCOPE);
        $liveContext->addState(self::MERGE_SCOPE);

        // group all payloads by their action (insert, update, delete) and by their entity name         $writes = $this->buildWrites($commits);

        // execute writes and get access to the write result to dispatch events later on         $result = $this->executeWrites($writes$liveContext);

        // remove commits which reference the version and create a "merge commit" for the live version with all payloads         $this->updateVersionData($commits$writeContext$versionId);

        // delete all versioned records         $this->deleteClones($commits$versionContext$versionId);

        // release lock to ensure no other merge is running         $lock->release();

        // dispatch events to trigger indexer and other subscribts
Home | Imprint | This part of the site doesn't use cookies.