/** * Get the hashcode for this object data array. * * @param boolean $includeStandardFields Wheter or not to include standard fields to hashcode. * @param array $objData Object data. * * @return string Hashcode. */ public function getHash($includeStandardFields = true, $objData = null) { if (!$objData) { $objData = $this->_objData; } if (!$includeStandardFields) { $objData = $this->_objData; // copy ObjectUtil::removeStandardFieldsFromObject($objData); } return hash('sha1', serialize($objData)); }
/** * Get the hashcode for this object data array. * * @param boolean $includeStandardFields Wheter or not to include standard fields to hashcode. * @param array $objArray Object data. * * @return string Hashcode. */ public function getHash($includeStandardFields = true, $objArray = null) { if (!$objArray) { $objArray = $this->_objData; } $arrayHash = array(); foreach ($objArray as $obj) { if (!$includeStandardFields) { ObjectUtil::removeStandardFieldsFromObject($obj); } $arrayHash[] = DataUtil::hash(serialize($obj)); } return DataUtil::hash(serialize($arrayHash)); }