Skip to content

Commit

Permalink
Handle cases where schema info is not available from metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienHarper committed Jan 28, 2019
1 parent c839ee8 commit 955af68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DoctrineAuditBundle/AuditReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function getAudits($entity, int $id = null, int $page = 1, int $pageSize
{
$connection = $this->entityManager->getConnection();

$schema = $this->entityManager->getClassMetadata($entity)->table['schema'] ? $this->entityManager->getClassMetadata($entity)->table['schema'] . '.' : '';
$schema = isset($this->entityManager->getClassMetadata($entity)->table['schema']) ? $this->entityManager->getClassMetadata($entity)->table['schema'] . '.' : '';

$auditTable = implode('', [
$schema,
Expand Down Expand Up @@ -143,7 +143,7 @@ public function getAudit($entity, int $id)
{
$connection = $this->entityManager->getConnection();

$schema = $this->entityManager->getClassMetadata($entity)->table['schema'] ? $this->entityManager->getClassMetadata($entity)->table['schema'] . '.' : '';
$schema = isset($this->entityManager->getClassMetadata($entity)->table['schema']) ? $this->entityManager->getClassMetadata($entity)->table['schema'] . '.' : '';

$auditTable = implode('', [
$schema,
Expand Down

0 comments on commit 955af68

Please sign in to comment.