commit 5d0f8ac17517304edcc74e4dec51f01ba2470588
Author: vastja <vastja@gmail.com>
Date:   Thu Apr 16 21:16:47 2020 +0200

    Re #7857
    + mongo propojení přes php-extension - symfony mongo-odm-bundle se pro
    naši aplikaci nehodí

diff --git a/.docker-compose-dev.yml b/.docker-compose-dev.yml
index fe87206..edd2aeb 100644
--- a/.docker-compose-dev.yml
+++ b/.docker-compose-dev.yml
@@ -44,8 +44,10 @@ services:
                volumes:
                         - data-db:/data/db
                         - ./dev-dump:/dev-dump
+                        
 volumes:
     data-db:
+    
 networks:
        frontend:
        backend:
diff --git a/scripts/dev/build.bat b/scripts/dev/build.bat
index 860087a..86b46b1 100644
--- a/scripts/dev/build.bat
+++ b/scripts/dev/build.bat
@@ -1,6 +1,6 @@
 docker-compose down
 docker-compose -f .docker-compose-dev.yml up --build -d
+docker-compose exec php-fpm composer config extra.symfony.allow-contrib true --no-interaction --working-dir=/var/www/symfony
 docker-compose exec php-fpm composer install --no-interaction --working-dir=/var/www/symfony
 docker-compose exec php-fpm composer update --no-interaction --working-dir=/var/www/symfony
-docker-compose exec database mongorestore --username root --password root --authenticationDatabase admin --db open-data-db ./dev-dump/admin
-docker-compose exec database mongorestore --username root --password root --authenticationDatabase admin --db open-data-db ./dev-dump/data
+
diff --git a/website/composer.json b/website/composer.json
index 3aa34fc..a9eb075 100644
--- a/website/composer.json
+++ b/website/composer.json
@@ -7,15 +7,14 @@
         "php": "^7.2.5",
         "ext-ctype": "*",
         "ext-iconv": "*",
+        "doctrine/annotations": "*",
         "sensio/framework-extra-bundle": "^5.5",
         "symfony/console": "5.0.*",
         "symfony/dotenv": "5.0.*",
         "symfony/flex": "^1.3.1",
         "symfony/framework-bundle": "5.0.*",
-        "symfony/yaml": "5.0.*",
-        "doctrine/annotations": "*",
-        "symfony/twig-pack" : "*",
-        "doctrine/mongodb-odm-bundle": "*"
+        "symfony/twig-pack": "*",
+        "symfony/yaml": "5.0.*"
     },
     "require-dev": {
         "friendsofphp/php-cs-fixer": "^2.16",
@@ -63,7 +62,7 @@
     },
     "extra": {
         "symfony": {
-            "allow-contrib": false,
+            "allow-contrib": "true",
             "require": "5.0.*"
         }
     }
diff --git a/website/composer.lock b/website/composer.lock
index 19df447..6041b97 100644
--- a/website/composer.lock
+++ b/website/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "88fc942d3af8ccdab2c606f3ba3cb47f",
+    "content-hash": "d3c2690381cd0996c18c1c04aa5ca9aa",
     "packages": [
         {
             "name": "doctrine/annotations",
diff --git a/website/config/bundles.php b/website/config/bundles.php
index a0be87b..79e5d08 100644
--- a/website/config/bundles.php
+++ b/website/config/bundles.php
@@ -4,5 +4,5 @@ return [
     Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
     Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
     Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
-    Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
+    Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true]
 ];
diff --git a/website/src/Controller/HeatmapController.php b/website/src/Controller/HeatmapController.php
index dfedab3..33a0264 100644
--- a/website/src/Controller/HeatmapController.php
+++ b/website/src/Controller/HeatmapController.php
@@ -4,6 +4,9 @@ namespace App\Controller;
 
 use Symfony\Component\Routing\Annotation\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
+use Doctrine\ODM\MongoDB\DocumentManager;
+use App\Entity\OpenData;
+use MongoDB\Client;
 
 class HeatmapController extends AbstractController {
 
@@ -12,8 +15,24 @@ class HeatmapController extends AbstractController {
      */
     public function index() {
 
+        $client = new Client(
+            'mongodb://root:root@database',
+            [],
+            [
+                'typeMap' => [
+                    'array' => 'array',
+                    'document' => 'array',
+                    'root' => 'array',
+                ],
+            ]
+        );
+        
+        $db = $client->selectDatabase('open-data-db');
+        $collection = $db->selectCollection("KOLOBEZKY31102018");
+        $openData = $collection->find();
+
         return $this->render('heatmap.html.twig', [
-            'title' => 'Hello World!',
+            'open_data' => $openData->toArray()
         ]);
     }
 }
\ No newline at end of file
diff --git a/website/templates/heatmap.html.twig b/website/templates/heatmap.html.twig
index 36d9888..239159e 100644
--- a/website/templates/heatmap.html.twig
+++ b/website/templates/heatmap.html.twig
@@ -2,6 +2,8 @@
 
 {% block body %}
 
-    <h1> {{ title }} </h1>
+    {% for data in open_data %}
+        {{ data._id}} {{data.place}} {{ data.x }} {{ data.y }} {{ data.number }} {{ data.date }}<br>
+    {% endfor %}
 
 {% endblock %}
\ No newline at end of file
