Copied!

VersionComparisonServiceInterface

VersionComparisonServiceInterface.php : 14

Methods

publiccompare()

VersionComparisonServiceInterface.php : 29

Calculate difference between data in fieldTypes in given Versions.

public compare(VersionInfo $versionA, VersionInfo $versionB[, string|null $languageCode = null ]) : VersionDiff

Fields should implement \Ibexa\Contracts\Core\FieldType\Comparable and be registered with ibexa.field_type.comparable tag to get proper data to ComparisonEngine.

Engines should implement \Ibexa\Core\Comparison\ComparisonEngine and be registered with ibexa.field_type.comparable.engine.

Only Versions in same language can be compared.

Parameters

Name Type Default value Description
$versionA VersionInfo - -
$versionB VersionInfo - -
$languageCode string|null null

if not provided, initialLanguageCode of $versionA is used.

Return values

VersionDiff