private function getCommits(string
$versionId, WriteContext
$writeContext): VersionCommitCollection
{ $criteria =
new Criteria();
$criteria->
addFilter(new EqualsFilter('version_commit.versionId',
$versionId));
$criteria->
addSorting(new FieldSorting('version_commit.autoIncrement'
));
$commitIds =
$this->entitySearcher->
search($this->versionCommitDefinition,
$criteria,
$writeContext->
getContext());
$readCriteria =
new Criteria();
if ($commitIds->
getTotal() > 0
) { $readCriteria =
new Criteria($commitIds->
getIds());
} $readCriteria->
addAssociation('data'
);
$readCriteria ->
getAssociation('data'
) ->
addSorting(new FieldSorting('autoIncrement'
));
/** @var VersionCommitCollection $commits */
$commits =
$this->entityReader->
read($this->versionCommitDefinition,
$readCriteria,
$writeContext->
getContext());