public function listVocabularies() { $vocabularies = VocabularyController::getAvailable($this->app); return $this->app->json(array_map(function (ControlProviderInterface $vocabulary) { return ['type' => $vocabulary->getType(), 'name' => $vocabulary->getName()]; }, $vocabularies)); }
public function testGetAvailable() { $available = Controller::getAvailable(self::$DI['app']); $this->assertTrue(is_array($available)); foreach ($available as $controller) { $this->assertInstanceOf('\\Alchemy\\Phrasea\\Vocabulary\\ControlProvider\\ControlProviderInterface', $controller); } }
public function listVocabularies(Application $app, Request $request) { $vocabularies = VocabularyController::getAvailable($app); return $app->json(array_map(function ($vocabulary) { return ['type' => $vocabulary->getType(), 'name' => $vocabulary->getName()]; }, $vocabularies)); }