Procházet zdrojové kódy

CustomFields: overload AttributeDefinition::Fingerprint

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3997 a333f486-631f-4898-b8df-5754b55c2be0
romainq před 9 roky
rodič
revize
4c09215712

+ 11 - 0
core/attributedef.class.inc.php

@@ -6645,6 +6645,17 @@ class AttributeCustomFields extends AttributeDefinition
 	}
 
 	/**
+	 * 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
 	 * @param $value

+ 6 - 0
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();
 }