Projekt

Obecné

Profil

Stáhnout (863 Bajtů) Statistiky
| Větev: | Revize:
1
<?php
2

    
3
namespace App\Controller;
4

    
5
use Symfony\Component\Routing\Annotation\Route;
6
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
7
use Doctrine\ODM\MongoDB\DocumentManager;
8
use App\Entity\OpenData;
9
use MongoDB\Driver\Manager;
10
use MongoDB\Driver\Query;
11

    
12
class HeatmapController extends AbstractController {
13

    
14
    /**
15
     * @Route("/heatmap")
16
     */
17
    public function index() {
18

    
19
        $manager = new Manager(
20
            'mongodb://root:root@database'
21
        );
22
        
23
        $openData = $manager->executeQuery('open-data-db.KOLOBEZKY31102018', new Query([], []));
24
        $openData->setTypeMap([
25
            'array' => 'array',
26
            'document' => 'array',
27
            'root' => 'array'
28
            ]);
29
        
30
        return $this->render('heatmap.html.twig', [
31
            'open_data' => $openData->toArray()
32
        ]);
33

    
34
    }
35
}
(2-2/2)