Skip to content

Commit

Permalink
bundle preparements
Browse files Browse the repository at this point in the history
  • Loading branch information
dsentker committed Sep 12, 2017
1 parent 0b18d1a commit 7954521
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dsentker/watcher",
"description": "Allows to track changes on doctrine entities with an easy-to-use API.",
"version": "0.2.42",
"version": "0.2.43",
"license": "MIT",
"autoload": {
"psr-4": {
Expand Down
5 changes: 1 addition & 4 deletions src/Watcher/EventListener/LoadListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Watcher\EventListener;

use Doctrine\ORM\Event\LifecycleEventArgs;
use Watcher\Entity\EntityLog;
use Watcher\Entity\LogAccessor;
use Watcher\Repository\EntityLogRepository;

Expand All @@ -15,12 +14,10 @@ class LoadListener
*/
public function postLoad(LifecycleEventArgs $args)
{

$em = $args->getEntityManager();
$entity = $args->getEntity();

/** @var EntityLogRepository $logRepo */
$logRepo = $em->getRepository(EntityLog::class);
$logRepo = $args->getEntityManager()->getRepository(get_class($entity));

if ($entity instanceof LogAccessor) {
$entity->setLogs($logRepo->getLogsFromEntity($entity));
Expand Down

0 comments on commit 7954521

Please sign in to comment.