Skip to content
This repository was archived by the owner on Nov 17, 2020. It is now read-only.

Commit dee84f7

Browse files
committed
Fix a bug when determining the ID of an object
1 parent c984f1b commit dee84f7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

AbstractFixture.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,11 @@ public function load(ObjectManager $manager)
6363
*/
6464
protected function fixtureObject($datas)
6565
{
66-
// The ID is taken in account to force its use in the database
67-
$id = isset($datas['id']) ? $datas['id'] : (is_object($datas) && method_exists($datas, 'getId') && $datas->getId() ? $datas->getId() : null);
66+
// The ID is taken in account to force its use in the database.
67+
$id = (is_object($datas) && method_exists($datas, 'getId') && $datas->getId())
68+
? $datas->getId()
69+
: (isset($datas['id']) ? $datas['id'] : null);
70+
6871
$obj = null;
6972
$newObject = false;
7073
$addRef = false;

0 commit comments

Comments
 (0)