@@ 1179-1201 (lines=23) @@ | ||
1176 | * |
|
1177 | * @return int Hashcode |
|
1178 | */ |
|
1179 | public function hashCode() |
|
1180 | { |
|
1181 | $validPk = null !== $this->getId() && |
|
1182 | null !== $this->getLocale(); |
|
1183 | ||
1184 | $validPrimaryKeyFKs = 1; |
|
1185 | $primaryKeyFKs = []; |
|
1186 | ||
1187 | //relation banner_image_i18n_fk_03c8df to table banner_image |
|
1188 | if ($this->aBannerImage && $hash = spl_object_hash($this->aBannerImage)) { |
|
1189 | $primaryKeyFKs[] = $hash; |
|
1190 | } else { |
|
1191 | $validPrimaryKeyFKs = false; |
|
1192 | } |
|
1193 | ||
1194 | if ($validPk) { |
|
1195 | return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE)); |
|
1196 | } elseif ($validPrimaryKeyFKs) { |
|
1197 | return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE)); |
|
1198 | } |
|
1199 | ||
1200 | return spl_object_hash($this); |
|
1201 | } |
|
1202 | ||
1203 | /** |
|
1204 | * Returns the composite primary key for this object. |
@@ 1002-1024 (lines=23) @@ | ||
999 | * |
|
1000 | * @return int Hashcode |
|
1001 | */ |
|
1002 | public function hashCode() |
|
1003 | { |
|
1004 | $validPk = null !== $this->getId() && |
|
1005 | null !== $this->getLocale(); |
|
1006 | ||
1007 | $validPrimaryKeyFKs = 1; |
|
1008 | $primaryKeyFKs = []; |
|
1009 | ||
1010 | //relation banners_i18n_fk_c926a5 to table banners |
|
1011 | if ($this->aBanners && $hash = spl_object_hash($this->aBanners)) { |
|
1012 | $primaryKeyFKs[] = $hash; |
|
1013 | } else { |
|
1014 | $validPrimaryKeyFKs = false; |
|
1015 | } |
|
1016 | ||
1017 | if ($validPk) { |
|
1018 | return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE)); |
|
1019 | } elseif ($validPrimaryKeyFKs) { |
|
1020 | return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE)); |
|
1021 | } |
|
1022 | ||
1023 | return spl_object_hash($this); |
|
1024 | } |
|
1025 | ||
1026 | /** |
|
1027 | * Returns the composite primary key for this object. |