/** * @param ServiceLocator $services * @return TicketResource */ public function __invoke($services) { $api = $services->get(Client::class); $client = $api->tickets(); $queue = $services->get(QueuePluginManager::class); $queue = $queue->get('Eoko\\Zendesk\\Queue\\Ticket'); return new TicketResource($client, $queue); }
protected function createContainer() { $container = new ServiceLocator(); $container->set('array_iterator', new \ArrayIterator(range(1, 5))); $container->set('error', function () { throw new RuntimeException(); }); return new ZendDiContainerAdapter($container); }
/** * Set relevant keys from the target key section in config.ini * * @param $targetKey * @return void */ private function setConfigKeys($targetKey) { $this->targetKey = $targetKey; $vfConfig = $this->serviceLocator->get('VuFind\\Config')->get('config')->toArray(); $this->targetApiId = $vfConfig[$this->targetKey]['apiId']; $this->targetApiKey = $vfConfig[$this->targetKey]['apiKey']; }
/** * @return \Zend\Di\ServiceLocator */ public function getServiceLocator() { return $this->serviceLocator->getServiceLocator(); }