Add logging to error_log if entity has no fieldDump method. #330

This commit is contained in:
Korina Cordero 2020-03-09 07:30:11 +00:00
parent d7806a2664
commit 5b167ef680
2 changed files with 7 additions and 1 deletions

View file

@ -271,7 +271,7 @@ services:
arguments:
$token_storage: "@security.token_storage"
$log_db: '@influxdb_database'
$entities: ['App\Entity\User', 'App\Entity\Role']
$entities: ['App\Entity\User', 'App\Entity\Role', 'App\Entity\Partner']
tags:
- name: 'doctrine.event_listener'
event: 'onFlush'

View file

@ -53,6 +53,8 @@ class EntityListener
$this->writeToLogDB($object_class, $object->getID(), 'create', $fields, $user_id);
}
else
error_log($object_class . ' does not implement the AuditableEntity interface.');
}
}
@ -108,6 +110,8 @@ class EntityListener
$this->writeToLogDB($entity_class, $updated_entity->getID(), 'update', $fields, $user_id);
}
else
error_log($entity_class . ' does not implement the AuditableEntity interface.');
}
}
@ -130,6 +134,8 @@ class EntityListener
$this->writeToLogDB($entity_class, $deleted_id, 'delete', $fields, $user_id);
}
else
error_log($entity_class . ' does not implement the AuditableEntity interface.');
}
}