| @@ 1455-1469 (lines=15) @@ | ||
| 1452 | * |
|
| 1453 | * @return int Hashcode |
|
| 1454 | */ |
|
| 1455 | public function hashCode() |
|
| 1456 | { |
|
| 1457 | $validPk = null !== $this->getId(); |
|
| 1458 | ||
| 1459 | $validPrimaryKeyFKs = 0; |
|
| 1460 | $primaryKeyFKs = []; |
|
| 1461 | ||
| 1462 | if ($validPk) { |
|
| 1463 | return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE)); |
|
| 1464 | } elseif ($validPrimaryKeyFKs) { |
|
| 1465 | return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE)); |
|
| 1466 | } |
|
| 1467 | ||
| 1468 | return spl_object_hash($this); |
|
| 1469 | } |
|
| 1470 | ||
| 1471 | /** |
|
| 1472 | * Returns the primary key for this object (row). |
|
| @@ 1318-1332 (lines=15) @@ | ||
| 1315 | * |
|
| 1316 | * @return int Hashcode |
|
| 1317 | */ |
|
| 1318 | public function hashCode() |
|
| 1319 | { |
|
| 1320 | $validPk = null !== $this->getId(); |
|
| 1321 | ||
| 1322 | $validPrimaryKeyFKs = 0; |
|
| 1323 | $primaryKeyFKs = []; |
|
| 1324 | ||
| 1325 | if ($validPk) { |
|
| 1326 | return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE)); |
|
| 1327 | } elseif ($validPrimaryKeyFKs) { |
|
| 1328 | return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE)); |
|
| 1329 | } |
|
| 1330 | ||
| 1331 | return spl_object_hash($this); |
|
| 1332 | } |
|
| 1333 | ||
| 1334 | /** |
|
| 1335 | * Returns the primary key for this object (row). |
|