예제 #1
0
파일: DBObject.php 프로젝트: Silwereth/core
 /**
  * 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));
 }
예제 #2
0
 /**
  * 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));
 }