| @@ 1471-1485 (lines=15) @@ | ||
| 1468 | * |
|
| 1469 | * @return int Hashcode |
|
| 1470 | */ |
|
| 1471 | public function hashCode() |
|
| 1472 | { |
|
| 1473 | $validPk = null !== $this->getId(); |
|
| 1474 | ||
| 1475 | $validPrimaryKeyFKs = 0; |
|
| 1476 | $primaryKeyFKs = []; |
|
| 1477 | ||
| 1478 | if ($validPk) { |
|
| 1479 | return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE)); |
|
| 1480 | } elseif ($validPrimaryKeyFKs) { |
|
| 1481 | return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE)); |
|
| 1482 | } |
|
| 1483 | ||
| 1484 | return spl_object_hash($this); |
|
| 1485 | } |
|
| 1486 | ||
| 1487 | /** |
|
| 1488 | * Returns the primary key for this object (row). |
|
| @@ 1242-1256 (lines=15) @@ | ||
| 1239 | * |
|
| 1240 | * @return int Hashcode |
|
| 1241 | */ |
|
| 1242 | public function hashCode() |
|
| 1243 | { |
|
| 1244 | $validPk = null !== $this->getId(); |
|
| 1245 | ||
| 1246 | $validPrimaryKeyFKs = 0; |
|
| 1247 | $primaryKeyFKs = []; |
|
| 1248 | ||
| 1249 | if ($validPk) { |
|
| 1250 | return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE)); |
|
| 1251 | } elseif ($validPrimaryKeyFKs) { |
|
| 1252 | return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE)); |
|
| 1253 | } |
|
| 1254 | ||
| 1255 | return spl_object_hash($this); |
|
| 1256 | } |
|
| 1257 | ||
| 1258 | /** |
|
| 1259 | * Returns the primary key for this object (row). |
|