| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 18 | public function update(ApiCall $call, ApiKey $key, Pheal $pheal) |
||
| 19 | { |
||
| 20 | $charId = $call->getOwner()->getCharacterId(); |
||
| 21 | |||
| 22 | $query = 'delete from TariochEveapiFetcherBundle:CharMailingList c where c.ownerId=:ownerId'; |
||
| 23 | $this->entityManager |
||
| 24 | ->createQuery($query) |
||
| 25 | ->setParameter('ownerId', $charId) |
||
| 26 | ->execute(); |
||
| 27 | |||
| 28 | $api = $pheal->charScope->MailingLists(array('characterID' => $charId)); |
||
| 29 | |||
| 30 | foreach ($api->mailingLists as $listApi) { |
||
| 31 | $entity = new CharMailingList($charId, $listApi->listID); |
||
| 32 | $entity->setDisplayName($listApi->displayName); |
||
| 33 | $this->entityManager->persist($entity); |
||
| 34 | } |
||
| 35 | |||
| 36 | return $api->cached_until; |
||
| 37 | } |
||
| 38 | } |
||
| 39 |