Exemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function findAll($userId, $limit = null, $offset = null)
 {
     $subscriptions = $this->subscriptions->findAllByType($userId, self::IDENTIFIER, $limit, $offset);
     $calendars = new CalendarCollection();
     foreach ($subscriptions as $subscription) {
         try {
             $calendar = $this->generateCalendar($subscription);
             $calendars->add($calendar);
         } catch (CorruptDataException $ex) {
             continue;
         } catch (BackendUtils\Exception $ex) {
             continue;
         }
     }
     return $calendars;
 }
 /**
  * @param array $data
  * @param integer $format
  * @return ICalendarCollection
  */
 public function createCollectionFromData($data, $format)
 {
     $collection = new CalendarCollection();
     foreach ($data as $item) {
         try {
             $entity = $this->createEntity($item, $format);
             $collection->add($entity);
         } catch (CorruptDataException $ex) {
             $this->logger->info($ex->getMessage());
             continue;
         }
     }
     return $collection;
 }