Skip to content

Commit

Permalink
Added some type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienHarper committed Apr 12, 2019
1 parent dcdb0ce commit 02469a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DoctrineAuditBundle/Reader/AuditReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function getAudits($entity, $id = null, ?int $page = null, ?int $pageSize
}

$connection = $this->entityManager->getConnection();
$schema = $this->entityManager->getClassMetadata($entity)->getSchemaName();
$schema = $this->entityManager->getClassMetadata(\is_string($entity) ? $entity : \get_class($entity))->getSchemaName();

$auditTable = implode('', [
null === $schema ? '' : $schema.'.',
Expand Down Expand Up @@ -175,7 +175,7 @@ public function getAudits($entity, $id = null, ?int $page = null, ?int $pageSize
public function getAudit($entity, $id)
{
$connection = $this->entityManager->getConnection();
$schema = $this->entityManager->getClassMetadata($entity)->getSchemaName();
$schema = $this->entityManager->getClassMetadata(\is_string($entity) ? $entity : \get_class($entity))->getSchemaName();

$auditTable = implode('', [
null === $schema ? '' : $schema.'.',
Expand Down

0 comments on commit 02469a0

Please sign in to comment.