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