Conditions | 4 |
Paths | 3 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function postLoad(LifecycleEventArgs $args) |
||
20 | { |
||
21 | if ($token = $this->tokenStorage->getToken()) { |
||
22 | $user = $token->getUser(); |
||
23 | $entity = $args->getEntity(); |
||
24 | |||
25 | if ($entity instanceof PonthubFile && $user instanceof User) { |
||
26 | $entity->setDownloaded( |
||
27 | $args->getEntityManager() |
||
28 | ->getRepository('KIPonthubBundle:PonthubFileUser') |
||
29 | ->hasBeenDownloadedBy($entity, $user) |
||
30 | ); |
||
31 | } |
||
32 | } |
||
33 | } |
||
34 | } |
||
35 |