| @@ 117-133 (lines=17) @@ | ||
| 114 | * |
|
| 115 | * @return Response |
|
| 116 | */ |
|
| 117 | public function licenseesAction(): Response |
|
| 118 | { |
|
| 119 | $repository = $this->get('app.model_repository_licensee'); |
|
| 120 | ||
| 121 | $licensees = $repository->findAll(); |
|
| 122 | ||
| 123 | $output = array(); |
|
| 124 | /* @var $licensee \DembeloMain\Document\Licensee */ |
|
| 125 | foreach ($licensees as $licensee) { |
|
| 126 | $obj = new StdClass(); |
|
| 127 | $obj->id = $licensee->getId(); |
|
| 128 | $obj->name = $licensee->getName(); |
|
| 129 | $output[] = $obj; |
|
| 130 | } |
|
| 131 | ||
| 132 | return new Response(\json_encode($output)); |
|
| 133 | } |
|
| 134 | ||
| 135 | /** |
|
| 136 | * @Route("/licenseeSuggest", name="admin_licensee_suggest") |
|
| @@ 200-218 (lines=19) @@ | ||
| 197 | * |
|
| 198 | * @return Response |
|
| 199 | */ |
|
| 200 | public function topicsAction(): Response |
|
| 201 | { |
|
| 202 | $mongo = $this->get('doctrine_mongodb'); |
|
| 203 | /* @var $repository \Doctrine\ODM\MongoDB\DocumentRepository */ |
|
| 204 | $repository = $mongo->getRepository('DembeloMain:Topic'); |
|
| 205 | ||
| 206 | $users = $repository->findAll(); |
|
| 207 | ||
| 208 | $output = array(); |
|
| 209 | /* @var $user \DembeloMain\Document\Topic */ |
|
| 210 | foreach ($users as $user) { |
|
| 211 | $obj = new StdClass(); |
|
| 212 | $obj->id = $user->getId(); |
|
| 213 | $obj->name = $user->getName(); |
|
| 214 | $output[] = $obj; |
|
| 215 | } |
|
| 216 | ||
| 217 | return new Response(\json_encode($output)); |
|
| 218 | } |
|
| 219 | ||
| 220 | /** |
|
| 221 | * @Route("/save", name="admin_formsave") |
|