Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
26 | public function process(PsrMessage $message, PsrContext $session) |
||
27 | { |
||
28 | $movies = $message->getBody(); |
||
29 | $movies = unserialize($movies); |
||
30 | $moviesCount = 0; |
||
31 | |||
32 | foreach ($movies as $movie) { |
||
33 | $this->em->persist($movie); |
||
34 | $moviesCount++; |
||
35 | } |
||
36 | |||
37 | $this->em->flush(); |
||
38 | |||
39 | $this->logger->debug("Successfully saved {$moviesCount} movies!\r\n"); |
||
40 | $this->logger->debug("Properties:\r\n", $message->getProperties()); |
||
41 | |||
42 | return self::ACK; |
||
43 | } |
||
44 | |||
49 | } |