/** * @inheritdoc */ public function getLists($cache = true) { $id = 'newsletter.lists'; if ($cache && $this->cache->get($id)) { return json_decode($this->cache->get($id), true); } foreach ($this->drivers as $driver) { try { $this->checkDriverConfiguration($driver); } catch (NewsletterException $ex) { unset($this->drivers[$driver->getName()]); } } $result = []; if (is_array($this->lists) && count($this->lists) > 0) { $result = $this->lists; } else { foreach ($this->drivers as $driver) { $result[$driver->getName()] = $driver->getLists(); } } if ($cache) { $this->cache->set($id, json_encode($result)); } return json_decode($this->cache->get($id), true); }