if (!
$fk instanceof FkField ||
$value === null
) { continue;
} if ($fk->
is(NoConstraint::
class)) { continue;
} // create a hash for the foreign key which are used for the mapping
$primary =
[$fk->
getReferenceField() =>
$fk->
getSerializer()->
decode($fk,
$value)];
$hash = self::
createPrimaryHash((string) $fk->
getReferenceEntity(),
$primary);
// check if the hash/primary isn't persisted yet
if (isset($mapping[$hash])) { return true;
} } return false;
} /**
* @param array<string, string> $primary
*/