From 21564ff34044cd1d26da7a8a920afd2e58d32027 Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Fri, 15 Apr 2016 09:05:39 +0000 Subject: [PATCH] CustomFields: overload AttributeDefinition::Fingerprint SVN:trunk[3997] --- core/attributedef.class.inc.php | 11 +++++++++++ core/customfieldshandler.class.inc.php | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index 95b86711a..6b568b2dd 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -6644,6 +6644,17 @@ class AttributeCustomFields extends AttributeDefinition return $oHandler->WriteValues($oHostObject, $aValues); } + /** + * The part of the current attribute in the object's signature, for the supplied value + * @param $value The value of this attribute for the object + * @return string The "signature" for this field/attribute + */ + public function Fingerprint($value) + { + $oHandler = $this->GetHandler($value->GetValues()); + return $oHandler->GetValueFingerprint(); + } + /** * Check the validity of the data * @param DBObject $oHostObject diff --git a/core/customfieldshandler.class.inc.php b/core/customfieldshandler.class.inc.php index 1befb9c1d..f9d421700 100644 --- a/core/customfieldshandler.class.inc.php +++ b/core/customfieldshandler.class.inc.php @@ -131,4 +131,10 @@ abstract class CustomFieldsHandler * @return bool */ abstract public function CompareValues($aValuesA, $aValuesB); + + /** + * String representation of the value, must depend solely on the semantics + * @return string + */ + abstract public function GetValueFingerprint(); }