Skip to content

Commit

Permalink
fix: Context getAttribute comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Apr 13, 2022
1 parent c567cc5 commit 016df90
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function construct(
if (
null !== $object &&
$context->hasAttribute(static::EXCEPTION_ON_EXISTING) &&
true === $context->hasAttribute(static::EXCEPTION_ON_EXISTING)
true === $context->getAttribute(static::EXCEPTION_ON_EXISTING)
) {
throw new EntityAlreadyExistsException('Object already exists in database.');
}
Expand All @@ -72,7 +72,7 @@ public function construct(
$object = $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context);
if (
$context->hasAttribute(static::PERSIST_NEW_OBJECTS) &&
true === $context->hasAttribute(static::PERSIST_NEW_OBJECTS)
true === $context->getAttribute(static::PERSIST_NEW_OBJECTS)
) {
$this->entityManager->persist($object);
}
Expand All @@ -86,7 +86,7 @@ public function construct(

if (
$context->hasAttribute(static::FLUSH_NEW_OBJECTS) &&
true === $context->hasAttribute(static::FLUSH_NEW_OBJECTS)
true === $context->getAttribute(static::FLUSH_NEW_OBJECTS)
) {
$this->entityManager->flush();
}
Expand Down

0 comments on commit 016df90

Please sign in to comment.