Browse Source

Mise à jour du composer.json et modification des routes pour l'admin generator.

Bastien Sevajol 11 years ago
parent
commit
1ab931c109
100 changed files with 4046 additions and 6559 deletions
  1. 9 7
      app/bootstrap.php.cache
  2. 8 4
      app/config/routing.yml
  3. 8 5
      composer.json
  4. 233 198
      composer.lock
  5. 17 0
      src/Muzich/AdminBundle/Controller/DashboardController.php
  6. 19 0
      src/Muzich/AdminBundle/Resources/views/Dashboard/dashboard.html.twig
  7. 17 0
      src/Muzich/AdminBundle/Resources/views/Dashboard/welcome.html.twig
  8. 164 0
      src/Muzich/AdminBundle/Resources/views/base_admin_assetic_less.html.twig
  9. 0 0
      src/Muzich/CoreBundle/Resources/views/HelpTour/home.html.twig
  10. 0 0
      src/Muzich/CoreBundle/Resources/views/Helpbox/tags_prompt.html.twig
  11. 1 1
      vendor/autoload.php
  12. 0 4
      vendor/bin/doctrine
  13. 1 0
      vendor/bin/doctrine
  14. 0 43
      vendor/bin/doctrine.php
  15. 1 0
      vendor/bin/doctrine.php
  16. 1 1
      vendor/cedriclombardot/admingenerator-generator-bundle/Admingenerator/GeneratorBundle
  17. 1 1
      vendor/cedriclombardot/twig-generator
  18. 3 3
      vendor/composer/autoload_real.php
  19. 1160 1128
      vendor/composer/installed.json
  20. 1 1
      vendor/doctrine/common/lib/Doctrine/Common/Version.php
  21. 1 1
      vendor/doctrine/data-fixtures
  22. 1 1
      vendor/doctrine/dbal/.travis.yml
  23. 2 2
      vendor/doctrine/dbal/composer.json
  24. 1 0
      vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MySQLKeywords.php
  25. 1 0
      vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/OracleKeywords.php
  26. 3 3
      vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php
  27. 1 0
      vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php
  28. 1 1
      vendor/doctrine/dbal/lib/Doctrine/DBAL/Version.php
  29. 8 13
      vendor/doctrine/dbal/tests/Doctrine/Tests/TestInit.php
  30. 1 5
      vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/.travis.yml
  31. 1 1
      vendor/doctrine/doctrine-fixtures-bundle/Doctrine/Bundle/FixturesBundle
  32. 1 1
      vendor/doctrine/orm/composer.json
  33. 4 1
      vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php
  34. 4 0
      vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
  35. 2 1
      vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
  36. 1 0
      vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php
  37. 9 11
      vendor/doctrine/orm/lib/Doctrine/ORM/PersistentCollection.php
  38. 11 20
      vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php
  39. 1 1
      vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Base.php
  40. 10 4
      vendor/doctrine/orm/lib/Doctrine/ORM/Query/SqlWalker.php
  41. 4 0
      vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/CountOutputWalker.php
  42. 1 1
      vendor/doctrine/orm/lib/Doctrine/ORM/Version.php
  43. 24 2
      vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyBidirectionalAssociationTest.php
  44. 40 0
      vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1666Test.php
  45. 110 0
      vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2090Test.php
  46. 24 0
      vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/SimpleObjectHydratorTest.php
  47. 2 0
      vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php
  48. 1 1
      vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.yml
  49. 2 2
      vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC2069Entity.dcm.yml
  50. 14 0
      vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/ExprTest.php
  51. 17 0
      vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/CountOutputWalkerTest.php
  52. 7 42
      vendor/gedmo/doctrine-extensions/README.md
  53. 219 0
      vendor/gedmo/doctrine-extensions/doc/references.md
  54. 64 2
      vendor/gedmo/doctrine-extensions/doc/tree.md
  55. 1 1
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Blameable/BlameableListener.php
  56. 25 0
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Mapping/Annotation/Reference.php
  57. 21 0
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Mapping/Annotation/ReferenceMany.php
  58. 21 0
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Mapping/Annotation/ReferenceOne.php
  59. 7 0
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Mapping/Annotation/TreePath.php
  60. 22 0
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Mapping/Annotation/TreePathHash.php
  61. 215 0
      vendor/gedmo/doctrine-extensions/lib/Gedmo/References/LazyCollection.php
  62. 99 0
      vendor/gedmo/doctrine-extensions/lib/Gedmo/References/Mapping/Driver/Annotation.php
  63. 99 0
      vendor/gedmo/doctrine-extensions/lib/Gedmo/References/Mapping/Event/Adapter/ODM.php
  64. 98 0
      vendor/gedmo/doctrine-extensions/lib/Gedmo/References/Mapping/Event/Adapter/ORM.php
  65. 50 0
      vendor/gedmo/doctrine-extensions/lib/Gedmo/References/Mapping/Event/ReferencesAdapter.php
  66. 158 0
      vendor/gedmo/doctrine-extensions/lib/Gedmo/References/ReferencesListener.php
  67. 1 0
      vendor/gedmo/doctrine-extensions/lib/Gedmo/SoftDeleteable/Mapping/Validator.php
  68. 7 3
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Sortable/SortableListener.php
  69. 1 0
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Timestampable/Mapping/Driver/Annotation.php
  70. 1 0
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Timestampable/Mapping/Driver/Xml.php
  71. 1 0
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Timestampable/Mapping/Driver/Yaml.php
  72. 5 5
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Tool/Wrapper/EntityWrapper.php
  73. 1 2
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/TranslatableListener.php
  74. 22 0
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Mapping/Driver/Annotation.php
  75. 27 0
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Mapping/Driver/Yaml.php
  76. 24 3
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Mapping/Validator.php
  77. 41 8
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Strategy/AbstractMaterializedPath.php
  78. 1 1
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Uploadable/FilenameGenerator/FilenameGeneratorAlphanumeric.php
  79. 2 1
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Uploadable/FilenameGenerator/FilenameGeneratorInterface.php
  80. 1 1
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Uploadable/FilenameGenerator/FilenameGeneratorSha1.php
  81. 5 3
      vendor/gedmo/doctrine-extensions/lib/Gedmo/Uploadable/UploadableListener.php
  82. 0 148
      vendor/gedmo/doctrine-extensions/schemas/orm/doctrine-extensions-mapping.xsd
  83. 1 0
      vendor/gedmo/doctrine-extensions/schemas/orm/doctrine-extensions-mapping.xsd
  84. 58 0
      vendor/gedmo/doctrine-extensions/tests/Gedmo/References/Fixture/ODM/MongoDB/Product.php
  85. 105 0
      vendor/gedmo/doctrine-extensions/tests/Gedmo/References/Fixture/ORM/StockItem.php
  86. 123 0
      vendor/gedmo/doctrine-extensions/tests/Gedmo/References/ReferencesListenerTest.php
  87. 6 0
      vendor/gedmo/doctrine-extensions/tests/Gedmo/Tool/BaseTestCaseOM.php
  88. 108 0
      vendor/gedmo/doctrine-extensions/tests/Gedmo/Tree/Fixture/MPFeaturesCategory.php
  89. 109 0
      vendor/gedmo/doctrine-extensions/tests/Gedmo/Tree/MaterializedPathORMFeaturesTest.php
  90. 1 1
      vendor/gedmo/doctrine-extensions/tests/Gedmo/Uploadable/FilenameGenerator/FilenameGeneratorAlphanumericTest.php
  91. 2 2
      vendor/gedmo/doctrine-extensions/tests/Gedmo/Uploadable/UploadableEntityTest.php
  92. 1 0
      vendor/gedmo/doctrine-extensions/tests/bootstrap.php
  93. 3 0
      vendor/gedmo/doctrine-extensions/tests/phpunit.xml.dist
  94. 1 1
      vendor/gregwar/image-bundle/Gregwar/ImageBundle
  95. 14 85
      vendor/jdorn/sql-formatter/README.md
  96. BIN
      vendor/jdorn/sql-formatter/examples/SqlFormatterExample.png
  97. 0 14
      vendor/jdorn/sql-formatter/examples/examples.php
  98. 321 403
      vendor/jdorn/sql-formatter/lib/SqlFormatter.php
  99. 0 4365
      vendor/jdorn/sql-formatter/tests/expected.html
  100. 0 0
      vendor/jdorn/sql-formatter/tests/performance.php

+ 9 - 7
app/bootstrap.php.cache View File

@@ -265,8 +265,10 @@ class Container implements IntrospectableContainerInterface
265 265
             unset($this->scopedServices[$name]);
266 266
 
267 267
             foreach ($this->scopeChildren[$name] as $child) {
268
-                $services[$child] = $this->scopedServices[$child];
269
-                unset($this->scopedServices[$child]);
268
+                if (isset($this->scopedServices[$child])) {
269
+                    $services[$child] = $this->scopedServices[$child];
270
+                    unset($this->scopedServices[$child]);
271
+                }
270 272
             }
271 273
 
272 274
                         $this->services = call_user_func_array('array_diff_key', $services);
@@ -509,11 +511,11 @@ abstract class Kernel implements KernelInterface, TerminableInterface
509 511
     protected $classes;
510 512
     protected $errorReportingLevel;
511 513
 
512
-    const VERSION         = '2.1.7';
513
-    const VERSION_ID      = '20107';
514
+    const VERSION         = '2.1.9';
515
+    const VERSION_ID      = '20109';
514 516
     const MAJOR_VERSION   = '2';
515 517
     const MINOR_VERSION   = '1';
516
-    const RELEASE_VERSION = '7';
518
+    const RELEASE_VERSION = '9';
517 519
     const EXTRA_VERSION   = '';
518 520
 
519 521
     
@@ -1641,12 +1643,12 @@ class HttpKernel extends BaseHttpKernel
1641 1643
         $request = $this->container->get('request');
1642 1644
 
1643 1645
                 if (0 === strpos($controller, 'http://') || 0 === strpos($controller, 'https://')) {
1644
-            $subRequest = Request::create($controller, 'get', array(), $request->cookies->all(), array(), $request->server->all());
1646
+            $subRequest = $request::create($controller, 'get', array(), $request->cookies->all(), array(), $request->server->all());
1645 1647
             if ($session = $request->getSession()) {
1646 1648
                 $subRequest->setSession($session);
1647 1649
             }
1648 1650
         } elseif (0 === strpos($controller, '/')) {
1649
-            $subRequest = Request::create($request->getUriForPath($controller), 'get', array(), $request->cookies->all(), array(), $request->server->all());
1651
+            $subRequest = $request::create($request->getUriForPath($controller), 'get', array(), $request->cookies->all(), array(), $request->server->all());
1650 1652
             if ($session = $request->getSession()) {
1651 1653
                 $subRequest->setSession($session);
1652 1654
             }

+ 8 - 4
app/config/routing.yml View File

@@ -48,15 +48,19 @@ MuzichCommentBundle:
48 48
   resource: "@MuzichCommentBundle/Resources/config/routing.yml"
49 49
   prefix:   /{_locale}/
50 50
   
51
-AdmingeneratorGeneratorBundle_Dashboard:
52
-    resource: "@AdmingeneratorGeneratorBundle/Resources/config/routing.yml"
53
-    prefix:   /
54
-
55 51
 shtumi_useful:
56 52
     resource: '@ShtumiUsefulBundle/Resources/config/routing.xml'
57 53
     prefix:   /system/search/
58 54
 
59 55
 ########## ADMIN
56
+MuzichAdminBundle:
57
+    resource: "@MuzichAdminBundle/Resources/config/routing.yml"
58
+    prefix: /admin/
59
+    
60
+AdmingeneratorDashboard_welcome:
61
+    pattern: /admin/dashboard
62
+    defaults: { _controller: MuzichAdminBundle:Dashboard:welcome }
63
+
60 64
 MuzichAdminBundle_admin_muzich_admin_bundle_admin_element:
61 65
     resource: "@MuzichAdminBundle/Controller/Admin_element/"
62 66
     type:     admingenerator

+ 8 - 5
composer.json View File

@@ -26,12 +26,15 @@
26 26
         "doctrine/doctrine-fixtures-bundle": "dev-master",
27 27
         "stof/doctrine-extensions-bundle": "dev-master",
28 28
         "gregwar/image-bundle": "dev-master",
29
-        "cedriclombardot/admingenerator-generator-bundle": "dev-master",
29
+        "cedriclombardot/admingenerator-generator-bundle": "1.0.*@dev",
30
+        "cedriclombardot/twig-generator": "dev-master",
31
+        "white-october/pagerfanta-bundle": "1.0.*@dev",
32
+        "pagerfanta/pagerfanta": "1.0.*@dev",
30 33
         "shtumi/useful-bundle": "dev-master",
31
-        "sonata-project/doctrine-orm-admin-bundle": "dev-master",
32
-        "sonata-project/admin-bundle": "dev-master",
33
-        "sonata-project/jquery-bundle": "dev-master",
34
-        "sonata-project/block-bundle": "dev-master"
34
+        "sonata-project/doctrine-orm-admin-bundle": "2.1.*@dev",
35
+        "sonata-project/admin-bundle": "2.1.*@dev",
36
+        "sonata-project/jquery-bundle": "1.8.*@dev",
37
+        "sonata-project/block-bundle": "2.1.*@dev"
35 38
     },
36 39
     "scripts": {
37 40
         "post-install-cmd": [

File diff suppressed because it is too large
+ 233 - 198
composer.lock


+ 17 - 0
src/Muzich/AdminBundle/Controller/DashboardController.php View File

@@ -0,0 +1,17 @@
1
+<?php
2
+
3
+namespace Muzich\AdminBundle\Controller;
4
+
5
+use Muzich\CoreBundle\lib\Controller;
6
+use Symfony\Component\HttpFoundation\Request;
7
+
8
+class DashboardController extends Controller
9
+{
10
+  public function welcomeAction()
11
+  {
12
+    return $this->render('MuzichAdminBundle:Dashboard:welcome.html.twig', array(
13
+      'base_admin_template' => $this->container->getParameter('admingenerator.base_admin_template'),
14
+    ));
15
+  }
16
+  
17
+}

+ 19 - 0
src/Muzich/AdminBundle/Resources/views/Dashboard/dashboard.html.twig View File

@@ -0,0 +1,19 @@
1
+{% extends base_admin_template %}
2
+
3
+{% block body %}    
4
+    <div class="row-fluid">
5
+      <div class="span3">
6
+        <div class="well well-small sidebar-nav">
7
+          {{ knp_menu_render('dashboard') }}
8
+        </div><!--/.well -->
9
+      </div><!--/span-->
10
+      <div class="span9">
11
+          {% block content %}
12
+          {% endblock %}
13
+      </div><!--/span-->
14
+    </div><!--/row-->
15
+{% endblock %}
16
+    
17
+{% block javascripts %}
18
+    {{ parent() }}
19
+{% endblock %}

+ 17 - 0
src/Muzich/AdminBundle/Resources/views/Dashboard/welcome.html.twig View File

@@ -0,0 +1,17 @@
1
+{% extends 'MuzichAdminBundle:Dashboard:dashboard.html.twig' %}
2
+
3
+{% block title %}Admingenerator{% endblock %}
4
+
5
+{% block content %}
6
+    <div class="hero-unit">          
7
+      {% block page_title %}
8
+          <header>
9
+              <h1>Muzi.ch Admin</h1>
10
+          </header>
11
+      {% endblock %}
12
+      <p>Administration interface of muzi.ch.</p>
13
+    </div>
14
+    <div class="row-fluid">
15
+      Ici prendron place les données statistiques
16
+    </div><!--/row-->
17
+{% endblock %}

+ 164 - 0
src/Muzich/AdminBundle/Resources/views/base_admin_assetic_less.html.twig View File

@@ -0,0 +1,164 @@
1
+<!DOCTYPE html>
2
+<html>
3
+  <head>
4
+    <meta charset="utf-8">
5
+    <title>{% block title %}Admin{% endblock %}</title>
6
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+
8
+    {% block scripts_head %}
9
+        <!-- jquery.min.js -->
10
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/jquery-1.8.3.min.js') }}"></script>
11
+        
12
+        <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
13
+        <!--[if lt IE 9]>
14
+            <script src="{{ asset('bundles/admingeneratorgenerator/js/html5shiv/html5.js') }}"></script>
15
+        <![endif]-->
16
+    {% endblock %}
17
+
18
+    {% block stylesheets %}
19
+        <!-- bootstrap.min.css -->
20
+        <link rel="stylesheet" href="{{ asset('bundles/admingeneratorgenerator/css/bootstrap/bootstrap.css') }}" type="text/css" media="all" />
21
+        <link rel="stylesheet" href="{{ asset('bundles/admingeneratorgenerator/css/bootstrap/bootstrap-extended.css') }}" type="text/css" media="all" />
22
+        <link rel="stylesheet" href="{{ asset('bundles/admingeneratorgenerator/css/bootstrap/bootstrap-datepicker.css') }}" type="text/css" media="all" />
23
+        <link rel="stylesheet" href="{{ asset('bundles/admingeneratorgenerator/css/google/prettify.css') }}" type="text/css" media="all" />
24
+                    
25
+        <!-- bootstrap-responsive.min.css -->
26
+        <link rel="stylesheet" href="{{ asset('bundles/admingeneratorgenerator/css/bootstrap/bootstrap-responsive.css') }}" type="text/css" media="all" />
27
+        <link rel="stylesheet" href="{{ asset('bundles/admingeneratorgenerator/css/bootstrap/bootstrap-responsive-extended.css') }}" type="text/css" media="all" />
28
+        
29
+        <!-- admingenerator.min.css -->
30
+        <link rel="stylesheet" href="{{ asset('bundles/admingeneratorgenerator/css/admingenerator/general.css') }}" type="text/css" media="all" />
31
+        <link rel="stylesheet" href="{{ asset('bundles/admingeneratorgenerator/css/admingenerator/nested-list.css') }}" type="text/css" media="all" />
32
+        <link rel="stylesheet" href="{{ asset('bundles/admingeneratorgenerator/css/admingenerator/collection.css') }}" type="text/css" media="all" />
33
+        <link rel="stylesheet" href="{{ asset('bundles/admingeneratorgenerator/css/admingenerator/upload.css') }}" type="text/css" media="all" />
34
+        <link rel="stylesheet" href="{{ asset('bundles/admingeneratorgenerator/css/admingenerator/filetypeicons.css') }}" type="text/css" media="all" />
35
+        <link rel="stylesheet" href="{{ asset('bundles/admingeneratorgenerator/css/admingenerator/form/single-upload.css') }}" type="text/css" media="all" />
36
+    {% endblock %}
37
+
38
+    {% block icons %}
39
+        <!-- Favicon and touch icons -->
40
+        <link rel="shortcut icon" href="{{ asset('bundles/admingeneratorgenerator/ico/favicon.ico') }}">
41
+        <link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ asset('bundles/admingeneratorgenerator/ico/apple-touch-icon-144-precomposed.png') }}">
42
+        <link rel="apple-touch-icon-precomposed" sizes="114x114" href="{{ asset('bundles/admingeneratorgenerator/ico/apple-touch-icon-114-precomposed.png') }}">
43
+        <link rel="apple-touch-icon-precomposed" sizes="72x72" href="{{ asset('bundles/admingeneratorgenerator/ico/apple-touch-icon-72-precomposed.png') }}">
44
+        <link rel="apple-touch-icon-precomposed" href="{{ asset('bundles/admingeneratorgenerator/ico/apple-touch-icon-57-precomposed.png') }}">
45
+    {% endblock %}
46
+    
47
+    
48
+    <link rel="stylesheet" href="{{ asset('css/jquery-ui-1.10.1.autocomplete.min.css') }}" type="text/css" media="all" />
49
+    <script type="text/javascript" src="{{ asset('js/jquery-ui-1.10.1.autocomplete.min.js') }}"></script>
50
+    
51
+  </head>
52
+
53
+  <body>
54
+
55
+    <div class="navbar navbar-inverse navbar-fixed-top">
56
+      <div class="navbar-inner">
57
+        <div class="container">
58
+          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
59
+            <span class="icon-bar"></span>
60
+            <span class="icon-bar"></span>
61
+            <span class="icon-bar"></span>
62
+          </a>
63
+          {% block logo %}
64
+            <a class="brand" href="{{ path('AdmingeneratorDashboard_welcome') }}">Admin</a>
65
+          {% endblock %}
66
+          <div class="nav-collapse collapse">
67
+            {% block profile %}
68
+              <ul class="nav pull-right">
69
+                <li><p class="navbar-text" style="padding-right: 10px;">{{ 'profile.welcome'|trans({'%username%': app.user ? app.user : 'anonymous'}, 'Admingenerator')|raw }}</li>
70
+                {% if app.user %}
71
+                  <li><button onclick="document.location='{{ path('fos_user_security_logout') }}'" class="btn " title="{{ 'profile.logout'|trans({}, 'Admingenerator') }}"><i class="icon-off"></i> {{ 'profile.logout'|trans({}, 'Admingenerator') }}</button></li>
72
+                {% else %}
73
+                  <li><button onclick="document.location='{{ path('fos_user_security_login') }}'" class="btn " title="{{ 'profile.login'|trans({}, 'Admingenerator') }}">{{ 'profile.login'|trans({}, 'Admingenerator') }}</button></li>
74
+                {% endif %}
75
+              </ul>
76
+            {% endblock %}
77
+            {% block menu %}
78
+              {{ knp_menu_render('admin') }}
79
+              {{ knp_menu_render('moderation') }}
80
+            {% endblock %}
81
+          </div><!--/.nav-collapse -->
82
+        </div>
83
+      </div>
84
+    </div>
85
+
86
+    <div class="container-fluid">
87
+        {% block flashes %}
88
+            <div id="flashes" class="row-fluid">
89
+                {% if app.session.hasFlash('success') %}
90
+                  <div class="alert alert-success">
91
+                    <button type="button" class="close" data-dismiss="alert">×</button>
92
+                    {{ app.session.flash('success')|raw }}
93
+                  </div>
94
+                {% endif %}
95
+                {% if app.session.hasFlash('error') %}
96
+                  <div class="alert alert-error">
97
+                    <button type="button" class="close" data-dismiss="alert">×</button>
98
+                    {{ app.session.flash('error')|raw }}
99
+                  </div>
100
+                {% endif %}
101
+            </div><!--/row-->
102
+        {% endblock %}
103
+
104
+        {% block body %}
105
+            <div class="row-fluid">
106
+            </div><!--/row-->
107
+        {% endblock %}
108
+
109
+      <hr>
110
+
111
+      <footer>
112
+        <p>
113
+          {% block footer %}
114
+              &copy; Symfony2Admingenerator {{ ("now"|date('Y') > 2012) ? '2012 - ' ~ "now"|date('Y') : '2012' }}
115
+          {% endblock %}
116
+        </p>
117
+      </footer>
118
+
119
+    </div> <!-- /container -->
120
+
121
+    {% block javascripts %}
122
+        <!-- bootstrap.min.js -->
123
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/bootstrap/bootstrap-transition.js') }}"></script>
124
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/bootstrap/bootstrap-alert.js') }}"></script>
125
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/bootstrap/bootstrap-modal.js') }}"></script>
126
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/bootstrap/bootstrap-dropdown.js') }}"></script>
127
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/bootstrap/bootstrap-scrollspy.js') }}"></script>
128
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/bootstrap/bootstrap-tab.js') }}"></script>
129
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/bootstrap/bootstrap-tooltip.js') }}"></script>
130
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/bootstrap/bootstrap-popover.js') }}"></script>
131
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/bootstrap/bootstrap-button.js') }}"></script>
132
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/bootstrap/bootstrap-collapse.js') }}"></script>
133
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/bootstrap/bootstrap-carousel.js') }}"></script>
134
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/bootstrap/bootstrap-typeahead-extended.js') }}"></script>
135
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/bootstrap/bootstrap-affix.js') }}"></script>
136
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/bootstrap/bootstrap-datepicker.js') }}"></script>
137
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/bootstrap/locales/bootstrap-datepicker.' ~ app.request.locale ~ '.js') }}"></script>
138
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/google/prettify.js') }}"></script>
139
+        
140
+        <!-- jquery-ui.min.js  -->
141
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/jquery-ui/jquery.ui.core.js') }}"></script>
142
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/jquery-ui/jquery.ui.widget.js') }}"></script>
143
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/jquery-ui/jquery.ui.mouse.js') }}"></script>
144
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/jquery-ui/jquery.ui.draggable.js') }}"></script>
145
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/jquery-ui/jquery.ui.droppable.js') }}"></script>
146
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/jquery-ui/jquery.ui.sortable.js') }}"></script>
147
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/jquery-ui/jquery.ui.effect.js') }}"></script>
148
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/jquery-ui/jquery.ui.effect-slide.js') }}"></script>
149
+       
150
+        <!-- blueimp.jquery-file-upload.min.js  -->
151
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/blueimp/blueimp.javascript-templates.min.js') }}"></script>
152
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/blueimp/blueimp.javascript-load-image.min.js') }}"></script>
153
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/blueimp/blueimp.canvas-to-blob.min.js') }}"></script>
154
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/blueimp/jquery.iframe-transport.js') }}"></script>
155
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/blueimp/jquery.fileupload.js') }}"></script>
156
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/blueimp/jquery.fileupload-fp.js') }}"></script>
157
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/blueimp/jquery.fileupload-ui.js') }}"></script>
158
+        
159
+        <!-- jquery.spin.min.js  -->
160
+        <script type="text/javascript" src="{{ asset('bundles/admingeneratorgenerator/js/spin/jquery.spin.js') }}"></script>
161
+    {% endblock %}
162
+
163
+  </body>
164
+</html>

+ 0 - 0
src/Muzich/CoreBundle/Resources/views/HelpTour/home.html.twig View File


+ 0 - 0
src/Muzich/CoreBundle/Resources/views/Helpbox/tags_prompt.html.twig View File


+ 1 - 1
vendor/autoload.php View File

@@ -4,4 +4,4 @@
4 4
 
5 5
 require_once __DIR__ . '/composer' . '/autoload_real.php';
6 6
 
7
-return ComposerAutoloaderInit6c3b313faf78baf847838c5239806fa1::getLoader();
7
+return ComposerAutoloaderInitc9b19a18ee3786b65d05efbb2e260c14::getLoader();

+ 0 - 4
vendor/bin/doctrine View File

@@ -1,4 +0,0 @@
1
-#!/usr/bin/env php
2
-<?php
3
-
4
-include('doctrine.php');

+ 1 - 0
vendor/bin/doctrine View File

@@ -0,0 +1 @@
1
+../doctrine/orm/bin/doctrine

+ 0 - 43
vendor/bin/doctrine.php View File

@@ -1,43 +0,0 @@
1
-<?php
2
-/*
3
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
- *
15
- * This software consists of voluntary contributions made by many individuals
16
- * and is licensed under the LGPL. For more information, see
17
- * <http://www.doctrine-project.org>.
18
- */
19
-
20
-(@include_once __DIR__ . '/../vendor/autoload.php') || @include_once __DIR__ . '/../../../autoload.php';
21
-$configFile = getcwd() . DIRECTORY_SEPARATOR . 'cli-config.php';
22
-
23
-$helperSet = null;
24
-if (file_exists($configFile)) {
25
-    if ( ! is_readable($configFile)) {
26
-        trigger_error(
27
-            'Configuration file [' . $configFile . '] does not have read permission.', E_ERROR
28
-        );
29
-    }
30
-
31
-    require $configFile;
32
-
33
-    foreach ($GLOBALS as $helperSetCandidate) {
34
-        if ($helperSetCandidate instanceof \Symfony\Component\Console\Helper\HelperSet) {
35
-            $helperSet = $helperSetCandidate;
36
-            break;
37
-        }
38
-    }
39
-}
40
-
41
-$helperSet = ($helperSet) ?: new \Symfony\Component\Console\Helper\HelperSet();
42
-
43
-\Doctrine\ORM\Tools\Console\ConsoleRunner::run($helperSet);

+ 1 - 0
vendor/bin/doctrine.php View File

@@ -0,0 +1 @@
1
+../doctrine/orm/bin/doctrine.php

+ 1 - 1
vendor/cedriclombardot/admingenerator-generator-bundle/Admingenerator/GeneratorBundle

@@ -1 +1 @@
1
-Subproject commit bc8c823b758c834c953cdfc50f023e82cebe2321
1
+Subproject commit dbcbd469aec90551e48730075f310d9bf6d92cb6

+ 1 - 1
vendor/cedriclombardot/twig-generator

@@ -1 +1 @@
1
-Subproject commit 3dd145ec52aad082774562788c709390289c3458
1
+Subproject commit b4a846956d330ed464070f6276801d16c92ae5c5

+ 3 - 3
vendor/composer/autoload_real.php View File

@@ -2,7 +2,7 @@
2 2
 
3 3
 // autoload_real.php generated by Composer
4 4
 
5
-class ComposerAutoloaderInit6c3b313faf78baf847838c5239806fa1
5
+class ComposerAutoloaderInitc9b19a18ee3786b65d05efbb2e260c14
6 6
 {
7 7
     private static $loader;
8 8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit6c3b313faf78baf847838c5239806fa1
19 19
             return self::$loader;
20 20
         }
21 21
 
22
-        spl_autoload_register(array('ComposerAutoloaderInit6c3b313faf78baf847838c5239806fa1', 'loadClassLoader'));
22
+        spl_autoload_register(array('ComposerAutoloaderInitc9b19a18ee3786b65d05efbb2e260c14', 'loadClassLoader'));
23 23
         self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
-        spl_autoload_unregister(array('ComposerAutoloaderInit6c3b313faf78baf847838c5239806fa1', 'loadClassLoader'));
24
+        spl_autoload_unregister(array('ComposerAutoloaderInitc9b19a18ee3786b65d05efbb2e260c14', 'loadClassLoader'));
25 25
 
26 26
         $vendorDir = dirname(__DIR__);
27 27
         $baseDir = dirname($vendorDir);

File diff suppressed because it is too large
+ 1160 - 1128
vendor/composer/installed.json


+ 1 - 1
vendor/doctrine/common/lib/Doctrine/Common/Version.php View File

@@ -36,7 +36,7 @@ class Version
36 36
     /**
37 37
      * Current Doctrine Version
38 38
      */
39
-    const VERSION = '2.3.1-DEV';
39
+    const VERSION = '2.3.0';
40 40
 
41 41
     /**
42 42
      * Compares a Doctrine version with the current one.

+ 1 - 1
vendor/doctrine/data-fixtures

@@ -1 +1 @@
1
-Subproject commit 261c41729843b6b1c7cf4e579d10f8daec119d43
1
+Subproject commit eef10f6b92706bdae2841a8fdeb45ad8999b15b3

+ 1 - 1
vendor/doctrine/dbal/.travis.yml View File

@@ -10,13 +10,13 @@ env:
10 10
   - DB=mysqli
11 11
 
12 12
 before_script:
13
+  - composer update --dev --prefer-source
13 14
   - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS doctrine_tests;' -U postgres; fi"
14 15
   - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS doctrine_tests_tmp;' -U postgres; fi"
15 16
   - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database doctrine_tests;' -U postgres; fi"
16 17
   - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database doctrine_tests_tmp;' -U postgres; fi"
17 18
   - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS doctrine_tests_tmp;create database IF NOT EXISTS doctrine_tests;'; fi"
18 19
   - sh -c "if [ '$DB' = 'mysqli' ]; then mysql -e 'create database IF NOT EXISTS doctrine_tests_tmp;create database IF NOT EXISTS doctrine_tests;'; fi"
19
-  - git submodule update --init
20 20
 
21 21
 script: phpunit --configuration tests/travis/$DB.travis.xml
22 22
 

+ 2 - 2
vendor/doctrine/dbal/composer.json View File

@@ -1,6 +1,6 @@
1 1
 {
2 2
     "name": "doctrine/dbal",
3
-    "type": "library",
3
+    "type": "library","version":"2.3.3",
4 4
     "description": "Database Abstraction Layer",
5 5
     "keywords": ["dbal", "database", "persistence", "queryobject"],
6 6
     "homepage": "http://www.doctrine-project.org",
@@ -13,7 +13,7 @@
13 13
     ],
14 14
     "require": {
15 15
         "php": ">=5.3.2",
16
-        "doctrine/common": "2.3.*"
16
+        "doctrine/common": ">=2.3.0,<2.5-dev"
17 17
     },
18 18
     "autoload": {
19 19
         "psr-0": { "Doctrine\\DBAL": "lib/" }

+ 1 - 0
vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/MySQLKeywords.php View File

@@ -190,6 +190,7 @@ class MySQLKeywords extends KeywordList
190 190
             'PROCEDURE',
191 191
             'PURGE',
192 192
             'RAID0',
193
+            'RANGE',
193 194
             'READ',
194 195
             'READS',
195 196
             'REAL',

+ 1 - 0
vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords/OracleKeywords.php View File

@@ -151,6 +151,7 @@ class OracleKeywords extends KeywordList
151 151
             'MODE',
152 152
             'ROWS',
153 153
             'WITH',
154
+            'RANGE',
154 155
         );
155 156
     }
156 157
 }

+ 3 - 3
vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php View File

@@ -59,10 +59,10 @@ abstract class AbstractSchemaManager
59 59
      *
60 60
      * @param \Doctrine\DBAL\Connection $conn
61 61
      */
62
-    public function __construct(\Doctrine\DBAL\Connection $conn)
62
+    public function __construct(\Doctrine\DBAL\Connection $conn, AbstractPlatform $platform = null)
63 63
     {
64
-        $this->_conn = $conn;
65
-        $this->_platform = $this->_conn->getDatabasePlatform();
64
+        $this->_conn     = $conn;
65
+        $this->_platform = $platform ?: $this->_conn->getDatabasePlatform();
66 66
     }
67 67
 
68 68
     /**

+ 1 - 0
vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php View File

@@ -40,6 +40,7 @@ class SQLServerSchemaManager extends AbstractSchemaManager
40 40
     protected function _getPortableTableColumnDefinition($tableColumn)
41 41
     {
42 42
         $dbType = strtolower($tableColumn['TYPE_NAME']);
43
+        $dbType = strtok($dbType, '(), ');
43 44
 
44 45
         $autoincrement = false;
45 46
         if (stripos($dbType, 'identity')) {

+ 1 - 1
vendor/doctrine/dbal/lib/Doctrine/DBAL/Version.php View File

@@ -36,7 +36,7 @@ class Version
36 36
     /**
37 37
      * Current Doctrine Version
38 38
      */
39
-    const VERSION = '2.3.3-DEV';
39
+    const VERSION = '2.3.3';
40 40
 
41 41
     /**
42 42
      * Compares a Doctrine version with the current one.

+ 8 - 13
vendor/doctrine/dbal/tests/Doctrine/Tests/TestInit.php View File

@@ -6,17 +6,12 @@ namespace Doctrine\Tests;
6 6
 
7 7
 error_reporting(E_ALL | E_STRICT);
8 8
 
9
-require_once __DIR__ . '/../../../lib/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php';
10
-
11
-$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', __DIR__ . '/../../../lib/vendor/doctrine-common/lib');
12
-$classLoader->register();
13
-
14
-$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', __DIR__ . '/../../../lib');
15
-$classLoader->register();
16
-
17
-$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Tests', __DIR__ . '/../../');
18
-$classLoader->register();
19
-
20
-$classLoader = new \Doctrine\Common\ClassLoader('Symfony', __DIR__ . "/../../../lib/vendor");
21
-$classLoader->register();
9
+if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) {
10
+    $loader = require_once __DIR__ . '/../../../vendor/autoload.php';
11
+} elseif (file_exists(__DIR__ . '/../../../../../autoload.php')) {
12
+    $loader = require __DIR__ . '/../../../vendor/autoload.php';
13
+} else {
14
+    throw new \RuntimeException('Could not locate composer autoloader');
15
+}
22 16
 
17
+$loader->add('Doctrine\Tests', __DIR__ . '/../../');

+ 1 - 5
vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/.travis.yml View File

@@ -3,10 +3,6 @@ language: php
3 3
 php:
4 4
   - 5.3
5 5
   - 5.4
6
-  - 5.5
7 6
 
8
-matrix:
9
-  allow_failures:
10
-    - php: 5.5
7
+before_script: composer install --dev
11 8
 
12
-before_script: composer install --dev --prefer-source

+ 1 - 1
vendor/doctrine/doctrine-fixtures-bundle/Doctrine/Bundle/FixturesBundle

@@ -1 +1 @@
1
-Subproject commit fcce1a0f1820983b89f50cd97d78aabf668442b7
1
+Subproject commit 275540d96599baec19fa3292c4d06c5cd4eefd06

+ 1 - 1
vendor/doctrine/orm/composer.json View File

@@ -1,6 +1,6 @@
1 1
 {
2 2
     "name": "doctrine/orm",
3
-    "type": "library",
3
+    "type": "library","version":"2.3.3",
4 4
     "description": "Object-Relational-Mapper for PHP",
5 5
     "keywords": ["orm", "database"],
6 6
     "homepage": "http://www.doctrine-project.org",

+ 4 - 1
vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php View File

@@ -178,10 +178,13 @@ class SimpleObjectHydrator extends AbstractHydrator
178 178
                 // One solution is to load the association, but it might require extra efforts.
179 179
                 return array('name' => $column);
180 180
 
181
-            default:
181
+            case (isset($this->_rsm->metaMappings[$column])):
182 182
                 return array(
183 183
                     'name' => $this->_rsm->metaMappings[$column]
184 184
                 );
185
+
186
+            default:
187
+                return null;
185 188
         }
186 189
     }
187 190
 }

+ 4 - 0
vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php View File

@@ -1421,6 +1421,10 @@ class ClassMetadataInfo implements ClassMetadata
1421 1421
         $mapping['orphanRemoval']   = isset($mapping['orphanRemoval']) ? (bool) $mapping['orphanRemoval'] : false;
1422 1422
         $mapping['isCascadeRemove'] = $mapping['orphanRemoval'] ? true : $mapping['isCascadeRemove'];
1423 1423
 
1424
+        if ($mapping['orphanRemoval']) {
1425
+            unset($mapping['unique']);
1426
+        }
1427
+
1424 1428
         if (isset($mapping['id']) && $mapping['id'] === true && !$mapping['isOwningSide']) {
1425 1429
             throw MappingException::illegalInverseIdentifierAssocation($this->name, $mapping['fieldName']);
1426 1430
         }

+ 2 - 1
vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php View File

@@ -233,6 +233,7 @@ class XmlDriver extends FileDriver
233 233
 
234 234
                 if (isset($mapping['version'])) {
235 235
                     $metadata->setVersionMapping($mapping);
236
+                    unset($mapping['version']);
236 237
                 }
237 238
 
238 239
                 $metadata->mapField($mapping);
@@ -662,7 +663,7 @@ class XmlDriver extends FileDriver
662 663
         }
663 664
 
664 665
         if (isset($fieldMapping['version']) && $fieldMapping['version']) {
665
-            $mapping['version'] = $fieldMapping['version'];
666
+            $mapping['version'] = $this->evaluateBoolean($fieldMapping['version']);
666 667
         }
667 668
 
668 669
         if (isset($fieldMapping['column-definition'])) {

+ 1 - 0
vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php View File

@@ -299,6 +299,7 @@ class YamlDriver extends FileDriver
299 299
 
300 300
                 if (isset($mapping['version'])) {
301 301
                     $metadata->setVersionMapping($mapping);
302
+                    unset($mapping['version']);
302 303
                 }
303 304
 
304 305
                 $metadata->mapField($mapping);

+ 9 - 11
vendor/doctrine/orm/lib/Doctrine/ORM/PersistentCollection.php View File

@@ -805,6 +805,10 @@ final class PersistentCollection implements Collection, Selectable
805 805
      */
806 806
     public function matching(Criteria $criteria)
807 807
     {
808
+        if ($this->isDirty) {
809
+            $this->initialize();
810
+        }
811
+
808 812
         if ($this->initialized) {
809 813
             return $this->coll->matching($criteria);
810 814
         }
@@ -813,16 +817,10 @@ final class PersistentCollection implements Collection, Selectable
813 817
             throw new \RuntimeException("Matching Criteria on PersistentCollection only works on OneToMany assocations at the moment.");
814 818
         }
815 819
 
816
-        // If there are NEW objects we have to check if any of them matches the criteria
817
-        $newObjects = array();
818
-
819
-        if ($this->isDirty) {
820
-            $newObjects = $this->coll->matching($criteria)->toArray();
821
-        }
822
-
823
-        $targetClass = $this->em->getClassMetadata(get_class($this->owner));
824
-
825
-        $id              = $targetClass->getSingleIdReflectionProperty()->getValue($this->owner);
820
+        $id              = $this->em
821
+            ->getClassMetadata(get_class($this->owner))
822
+            ->getSingleIdReflectionProperty()
823
+            ->getValue($this->owner);
826 824
         $builder         = Criteria::expr();
827 825
         $ownerExpression = $builder->eq($this->backRefFieldName, $id);
828 826
         $expression      = $criteria->getWhereExpression();
@@ -832,7 +830,7 @@ final class PersistentCollection implements Collection, Selectable
832 830
 
833 831
         $persister = $this->em->getUnitOfWork()->getEntityPersister($this->association['targetEntity']);
834 832
 
835
-        return new ArrayCollection(array_merge($persister->loadCriteria($criteria), $newObjects));
833
+        return new ArrayCollection($persister->loadCriteria($criteria));
836 834
     }
837 835
 }
838 836
 

+ 11 - 20
vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php View File

@@ -104,19 +104,8 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor
104 104
 
105 105
                     $updateSql .= $sqlWalker->walkUpdateItem($updateItem);
106 106
 
107
-                    //FIXME: parameters can be more deeply nested. traverse the tree.
108
-                    //FIXME (URGENT): With query cache the parameter is out of date. Move to execute() stage.
109 107
                     if ($newValue instanceof AST\InputParameter) {
110
-                        $parameterName = $newValue->name;
111
-                        $parameter     = $sqlWalker->getQuery()->getParameter($parameterName);
112
-
113
-                        $value = $sqlWalker->getQuery()->processParameterValue($parameter->getValue());
114
-                        $type  = ($parameter->getValue() === $value)
115
-                            ? $parameter->getType()
116
-                            : ParameterTypeInferer::inferType($value);
117
-
118
-                        $this->_sqlParameters[$i]['parameters'][] = $value;
119
-                        $this->_sqlParameters[$i]['types'][] = $type;
108
+                        $this->_sqlParameters[$i][] = $newValue->name;
120 109
 
121 110
                         ++$this->_numParametersInUpdateClause;
122 111
                     }
@@ -168,16 +157,18 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor
168 157
             );
169 158
 
170 159
             // Execute UPDATE statements
171
-            for ($i=0, $count=count($this->_sqlStatements); $i<$count; ++$i) {
172
-                $parameters = array();
173
-                $types      = array();
174
-
175
-                if (isset($this->_sqlParameters[$i])) {
176
-                    $parameters = isset($this->_sqlParameters[$i]['parameters']) ? $this->_sqlParameters[$i]['parameters'] : array();
177
-                    $types = isset($this->_sqlParameters[$i]['types']) ? $this->_sqlParameters[$i]['types'] : array();
160
+            foreach ($this->_sqlStatements as $key => $statement) {
161
+                $paramValues = array();
162
+                $paramTypes  = array();
163
+
164
+                if (isset($this->_sqlParameters[$key])) {
165
+                    foreach ($this->_sqlParameters[$key] as $parameterKey => $parameterName) {
166
+                        $paramValues[] = $params[$parameterKey];
167
+                        $paramTypes[]  = isset($types[$parameterKey]) ? $types[$parameterKey] : ParameterTypeInferer::inferType($params[$parameterKey]);
168
+                    }
178 169
                 }
179 170
 
180
-                $conn->executeUpdate($this->_sqlStatements[$i], $parameters, $types);
171
+                $conn->executeUpdate($statement, $paramValues, $paramTypes);
181 172
             }
182 173
         } catch (\Exception $exception) {
183 174
             // FAILURE! Drop temporary table to avoid possible collisions

+ 1 - 1
vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Base.php View File

@@ -83,7 +83,7 @@ abstract class Base
83 83
      */
84 84
     public function add($arg)
85 85
     {
86
-        if ( $arg !== null || ($arg instanceof self && $arg->count() > 0) ) {
86
+        if ( $arg !== null && (!$arg instanceof self || $arg->count() > 0) ) {
87 87
             // If we decide to keep Expr\Base instances, we can use this check
88 88
             if ( ! is_string($arg)) {
89 89
                 $class = get_class($arg);

+ 10 - 4
vendor/doctrine/orm/lib/Doctrine/ORM/Query/SqlWalker.php View File

@@ -750,7 +750,10 @@ class SqlWalker implements TreeWalker
750 750
         $sqlParts = array();
751 751
 
752 752
         foreach ($identificationVarDecls as $identificationVariableDecl) {
753
-            $sql = $this->walkRangeVariableDeclaration($identificationVariableDecl->rangeVariableDeclaration);
753
+            $sql = $this->platform->appendLockHint(
754
+                $this->walkRangeVariableDeclaration($identificationVariableDecl->rangeVariableDeclaration),
755
+                $this->query->getHint(Query::HINT_LOCK_MODE)
756
+            );
754 757
 
755 758
             foreach ($identificationVariableDecl->joins as $join) {
756 759
                 $sql .= $this->walkJoin($join);
@@ -770,7 +773,7 @@ class SqlWalker implements TreeWalker
770 773
                 }
771 774
             }
772 775
 
773
-            $sqlParts[] = $this->platform->appendLockHint($sql, $this->query->getHint(Query::HINT_LOCK_MODE));
776
+            $sqlParts[] = $sql;
774 777
         }
775 778
 
776 779
         return ' FROM ' . implode(', ', $sqlParts);
@@ -1367,13 +1370,16 @@ class SqlWalker implements TreeWalker
1367 1370
         $sqlParts = array ();
1368 1371
 
1369 1372
         foreach ($identificationVarDecls as $subselectIdVarDecl) {
1370
-            $sql = $this->walkRangeVariableDeclaration($subselectIdVarDecl->rangeVariableDeclaration);
1373
+            $sql = $this->platform->appendLockHint(
1374
+                $this->walkRangeVariableDeclaration($subselectIdVarDecl->rangeVariableDeclaration),
1375
+                $this->query->getHint(Query::HINT_LOCK_MODE)
1376
+            );
1371 1377
 
1372 1378
             foreach ($subselectIdVarDecl->joins as $join) {
1373 1379
                 $sql .= $this->walkJoin($join);
1374 1380
             }
1375 1381
 
1376
-            $sqlParts[] = $this->platform->appendLockHint($sql, $this->query->getHint(Query::HINT_LOCK_MODE));
1382
+            $sqlParts[] = $sql;
1377 1383
         }
1378 1384
 
1379 1385
         return ' FROM ' . implode(', ', $sqlParts);

+ 4 - 0
vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/CountOutputWalker.php View File

@@ -74,6 +74,10 @@ class CountOutputWalker extends SqlWalker
74 74
      */
75 75
     public function walkSelectStatement(SelectStatement $AST)
76 76
     {
77
+        if ($this->platform->getName() === "mssql") {
78
+            $AST->orderByClause = null;
79
+        }
80
+
77 81
         $sql = parent::walkSelectStatement($AST);
78 82
 
79 83
         // Find out the SQL alias of the identifier column of the root entity

+ 1 - 1
vendor/doctrine/orm/lib/Doctrine/ORM/Version.php View File

@@ -36,7 +36,7 @@ class Version
36 36
     /**
37 37
      * Current Doctrine Version
38 38
      */
39
-    const VERSION = '2.3.3-DEV';
39
+    const VERSION = '2.3.3';
40 40
 
41 41
     /**
42 42
      * Compares a Doctrine version with the current one.

+ 24 - 2
vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/OneToManyBidirectionalAssociationTest.php View File

@@ -173,14 +173,36 @@ class OneToManyBidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctiona
173 173
         $this->assertInstanceOf('Doctrine\Common\Collections\Collection', $results);
174 174
         $this->assertEquals(2, count($results));
175 175
     }
176
-	
176
+
177
+    /**
178
+     * @group DDC-2340
179
+     */
180
+    public function testMatchingOnDirtyCollection()
181
+    {
182
+        $this->_createFixture();
183
+
184
+        $product  = $this->_em->find('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $this->product->getId());
185
+
186
+        $thirdFeature = new ECommerceFeature();
187
+        $thirdFeature->setDescription('Model writing tutorial');
188
+
189
+        $features = $product->getFeatures();
190
+        $features->add($thirdFeature);
191
+
192
+        $results = $features->matching(new Criteria(
193
+            Criteria::expr()->eq('description', 'Model writing tutorial')
194
+        ));
195
+
196
+        $this->assertEquals(2, count($results));
197
+    }
198
+
177 199
     public function testMatchingBis()
178 200
     {
179 201
         $this->_createFixture();
180 202
 
181 203
         $product  = $this->_em->find('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $this->product->getId());
182 204
         $features = $product->getFeatures();
183
-        
205
+
184 206
         $thirdFeature = new ECommerceFeature();
185 207
         $thirdFeature->setDescription('Third feature');
186 208
         $product->addFeature($thirdFeature);

+ 40 - 0
vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1666Test.php View File

@@ -0,0 +1,40 @@
1
+<?php
2
+
3
+namespace Doctrine\Tests\ORM\Functional\Ticket;
4
+
5
+use Doctrine\Tests\Models\CMS\CmsUser;
6
+use Doctrine\Tests\Models\CMS\CmsEmail;
7
+
8
+/**
9
+ * @group DDC-1666
10
+ */
11
+class DDC1666Test extends \Doctrine\Tests\OrmFunctionalTestCase
12
+{
13
+    public function setUp()
14
+    {
15
+        $this->useModelSet('cms');
16
+        parent::setUp();
17
+    }
18
+
19
+    public function testGivenOrphanRemovalOneToOne_WhenReplacing_ThenNoUniqueConstraintError()
20
+    {
21
+        $user = new CmsUser();
22
+        $user->name = "Benjamin";
23
+        $user->username = "beberlei";
24
+        $user->status = "something";
25
+        $user->setEmail($email = new CmsEmail());
26
+        $email->setEmail("kontakt@beberlei.de");
27
+
28
+        $this->_em->persist($user);
29
+        $this->_em->flush();
30
+
31
+        $this->assertTrue($this->_em->contains($email));
32
+
33
+        $user->setEmail($newEmail = new CmsEmail());
34
+        $newEmail->setEmail("benjamin.eberlei@googlemail.com");
35
+
36
+        $this->_em->flush();
37
+
38
+        $this->assertFalse($this->_em->contains($email));
39
+    }
40
+}

+ 110 - 0
vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2090Test.php View File

@@ -0,0 +1,110 @@
1
+<?php
2
+
3
+namespace Doctrine\Tests\ORM\Functional\Ticket;
4
+
5
+use Doctrine\Tests\Models\Company\CompanyEmployee;
6
+
7
+/**
8
+ * @group DDC-2090
9
+ */
10
+class DDC2090Test extends \Doctrine\Tests\OrmFunctionalTestCase
11
+{
12
+    public function setUp()
13
+    {
14
+        $this->useModelSet('company');
15
+        parent::setUp();
16
+    }
17
+
18
+    public function testIssue()
19
+    {
20
+        $className = 'Doctrine\Tests\Models\Company\CompanyEmployee';
21
+        $date1     = new \DateTime('2011-11-11 11:11:11');
22
+        $date2     = new \DateTime('2012-12-12 12:12:12');
23
+        $employee1 = new CompanyEmployee;
24
+        $employee2 = new CompanyEmployee;
25
+
26
+        $employee1->setName("Fabio B. Silva");
27
+        $employee1->setStartDate(new \DateTime('yesterday'));
28
+        $employee1->setDepartment("R&D");
29
+        $employee1->setSalary(100);
30
+
31
+        $employee2->setName("Doctrine Bot");
32
+        $employee1->setStartDate(new \DateTime('yesterday'));
33
+        $employee2->setDepartment("QA");
34
+        $employee2->setSalary(100);
35
+
36
+        $this->_em->persist($employee1);
37
+        $this->_em->persist($employee2);
38
+        $this->_em->flush();
39
+        $this->_em->clear();
40
+
41
+        $this->_em->createQueryBuilder()
42
+            ->update($className, 'e')
43
+            ->set('e.startDate', ':date')
44
+            ->set('e.salary', ':salary')
45
+            ->where('e = :e')
46
+            ->setParameters(array(
47
+                'e'      => $employee1,
48
+                'date'   => $date1,
49
+                'salary' => 101,
50
+            ))
51
+            ->getQuery()
52
+            ->useQueryCache(true)
53
+            ->execute();
54
+
55
+        $this->_em->createQueryBuilder()
56
+            ->update($className, 'e')
57
+            ->set('e.startDate', ':date')
58
+            ->set('e.salary', ':salary')
59
+            ->where('e = :e')
60
+            ->setParameters(array(
61
+                'e'      => $employee2,
62
+                'date'   => $date2,
63
+                'salary' => 102,
64
+            ))
65
+            ->getQuery()
66
+            ->useQueryCache(true)
67
+            ->execute();
68
+
69
+        $this->_em->clear();
70
+
71
+        $e1 = $this->_em->find($className, $employee1->getId());
72
+        $e2 = $this->_em->find($className, $employee2->getId());
73
+
74
+        $this->assertEquals(101, $e1->getSalary());
75
+        $this->assertEquals(102, $e2->getSalary());
76
+        $this->assertEquals($date1, $e1->getStartDate());
77
+        $this->assertEquals($date2, $e2->getStartDate());
78
+
79
+        $this->_em->createQueryBuilder()
80
+            ->update($className, 'e')
81
+            ->set('e.startDate', '?1')
82
+            ->set('e.salary', '?2')
83
+            ->where('e = ?0')
84
+            ->setParameters(array($employee1, $date1, 101))
85
+            ->getQuery()
86
+            ->useQueryCache(true)
87
+            ->execute();
88
+
89
+        $this->_em->createQueryBuilder()
90
+            ->update($className, 'e')
91
+            ->set('e.startDate', '?1')
92
+            ->set('e.salary', '?2')
93
+            ->where('e = ?0')
94
+            ->setParameters(array($employee2, $date2, 102))
95
+            ->getQuery()
96
+            ->useQueryCache(true)
97
+            ->execute();
98
+
99
+
100
+        $this->_em->clear();
101
+
102
+        $e1 = $this->_em->find($className, $employee1->getId());
103
+        $e2 = $this->_em->find($className, $employee2->getId());
104
+
105
+        $this->assertEquals(101, $e1->getSalary());
106
+        $this->assertEquals(102, $e2->getSalary());
107
+        $this->assertEquals($date1, $e1->getStartDate());
108
+        $this->assertEquals($date2, $e2->getStartDate());
109
+    }
110
+}

+ 24 - 0
vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Hydration/SimpleObjectHydratorTest.php View File

@@ -34,4 +34,28 @@ class SimpleObjectHydratorTest extends HydrationTestCase
34 34
         $hydrator   = new \Doctrine\ORM\Internal\Hydration\SimpleObjectHydrator($this->_em);
35 35
         $hydrator->hydrateAll($stmt, $rsm);
36 36
     }
37
+
38
+    public function testExtraFieldInResultSetShouldBeIgnore()
39
+    {
40
+        $rsm = new ResultSetMapping;
41
+        $rsm->addEntityResult('Doctrine\Tests\Models\CMS\CmsAddress', 'a');
42
+        $rsm->addFieldResult('a', 'a__id', 'id');
43
+        $rsm->addFieldResult('a', 'a__city', 'city');
44
+        $resultSet = array(
45
+            array(
46
+                'a__id'   => '1',
47
+                'a__city' => 'Cracow',
48
+                'doctrine_rownum' => '1'
49
+            ),
50
+        );
51
+
52
+        $expectedEntity = new \Doctrine\Tests\Models\CMS\CmsAddress();
53
+        $expectedEntity->id = 1;
54
+        $expectedEntity->city = 'Cracow';
55
+
56
+        $stmt       = new HydratorMockStatement($resultSet);
57
+        $hydrator   = new \Doctrine\ORM\Internal\Hydration\SimpleObjectHydrator($this->_em);
58
+        $result = $hydrator->hydrateAll($stmt, $rsm);
59
+        $this->assertEquals($result[0], $expectedEntity);
60
+    }
37 61
 }

+ 2 - 0
vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php View File

@@ -156,6 +156,8 @@ abstract class AbstractMappingDriverTest extends \Doctrine\Tests\OrmTestCase
156 156
     {
157 157
         $this->assertTrue($class->isVersioned);
158 158
         $this->assertEquals("version", $class->versionField);
159
+
160
+        $this->assertFalse(isset($class->fieldMappings['version']['version']));
159 161
     }
160 162
 
161 163
     /**

+ 1 - 1
vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.yml View File

@@ -5,4 +5,4 @@ Doctrine\Tests\Models\DDC1476\DDC1476EntityWithDefaultFieldType:
5 5
       generator:
6 6
         strategy: NONE
7 7
   fields:
8
-    name:
8
+    name: ~

+ 2 - 2
vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC2069Entity.dcm.yml View File

@@ -1,7 +1,7 @@
1 1
 Doctrine\Tests\ORM\Mapping\DDC2069Entity:
2 2
   type: entity
3 3
   id:
4
-    id:
4
+    id: ~
5 5
   fields:
6 6
     name:
7 7
       type: string ( 255 )
@@ -12,4 +12,4 @@ Doctrine\Tests\ORM\Mapping\DDC2069Entity:
12 12
       columns: name, value
13 13
   indexes:
14 14
     0:
15
-      columns: value, name
15
+      columns: value, name

+ 14 - 0
vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Query/ExprTest.php View File

@@ -409,4 +409,18 @@ class ExprTest extends \Doctrine\Tests\OrmTestCase
409 409
         $select = new Expr\Select(array('foo', 'bar'));
410 410
         $this->assertEquals(array('foo', 'bar'), $select->getParts());
411 411
     }
412
+
413
+    public function testAddEmpty() {
414
+        $andExpr = $this->_expr->andx();
415
+        $andExpr->add($this->_expr->andx());
416
+        
417
+        $this->assertEquals(0, $andExpr->count());
418
+    }
419
+
420
+    public function testAddNull() {
421
+        $andExpr = $this->_expr->andx();
422
+        $andExpr->add(null);
423
+        
424
+        $this->assertEquals(0, $andExpr->count());
425
+    }
412 426
 }

+ 17 - 0
vendor/doctrine/orm/tests/Doctrine/Tests/ORM/Tools/Pagination/CountOutputWalkerTest.php View File

@@ -41,5 +41,22 @@ class CountOutputWalkerTest extends PaginationTestCase
41 41
             "SELECT COUNT(*) AS dctrn_count FROM (SELECT DISTINCT id1 FROM (SELECT count(u0_.id) AS sclr0, g1_.id AS id1, u0_.id AS id2 FROM groups g1_ LEFT JOIN user_group u2_ ON g1_.id = u2_.group_id LEFT JOIN User u0_ ON u0_.id = u2_.user_id GROUP BY g1_.id HAVING sclr0 > 0) dctrn_result) dctrn_table", $query->getSql()
42 42
         );
43 43
     }
44
+
45
+    public function testCountQueryOrderBySqlServer()
46
+    {
47
+        if ($this->entityManager->getConnection()->getDatabasePlatform()->getName() !== "mssql") {
48
+            $this->markTestSkipped('SQLServer only test.');
49
+        }
50
+
51
+        $query = $this->entityManager->createQuery(
52
+            'SELECT p FROM Doctrine\Tests\ORM\Tools\Pagination\BlogPost p ORDER BY p.id');
53
+        $query->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Doctrine\ORM\Tools\Pagination\CountOutputWalker');
54
+        $query->setFirstResult(null)->setMaxResults(null);
55
+
56
+        $this->assertEquals(
57
+            "SELECT COUNT(*) AS dctrn_count FROM (SELECT DISTINCT id0 FROM (SELECT b0_.id AS id0, b0_.author_id AS author_id1, b0_.category_id AS category_id2 FROM BlogPost b0_) dctrn_result) dctrn_table",
58
+            $query->getSql()
59
+        );
60
+    }
44 61
 }
45 62
 

+ 7 - 42
vendor/gedmo/doctrine-extensions/README.md View File

@@ -7,7 +7,7 @@ refactoring doctrine2 extensions. The repository can be moved to the maintainers
7 7
 left on mine. I do not want users to lose availability of stable extensions which they were and are
8 8
 used to, at the moment.
9 9
 
10
-**Version 2.3.4**
10
+**Version 2.3.5**
11 11
 
12 12
 [![Build Status](https://secure.travis-ci.org/l3pp4rd/DoctrineExtensions.png?branch=master)](http://travis-ci.org/l3pp4rd/DoctrineExtensions)
13 13
 
@@ -17,6 +17,10 @@ with latest version of doctrine mapping at master branches
17 17
 
18 18
 ### Latest updates
19 19
 
20
+**2013-03-05**
21
+
22
+- A new extension - **References**, which links Entities in Documents and visa versa, [read more about it](https://github.com/l3pp4rd/DoctrineExtensions/blob/master/doc/references.md). It was contributed by @jwage, @avalanche123, @jmikola and @bobthecow, thanks
23
+
20 24
 **2013-02-05**
21 25
 
22 26
 - **Sluggable** added back slug handler mapping driver support for yaml and xml.
@@ -35,47 +39,6 @@ with latest version of doctrine mapping at master branches
35 39
 - **Sluggable** now allows to regenerate slug if its set to empty or null. Also it allows to
36 40
 manually set the slug, in that case it would only transliterate it and ensure uniqueness.
37 41
 
38
-**2012-04-09**
39
-
40
-- **Translatable** now does not force lowercase letters on locale or language. If your database is case
41
-sensitive, take this into account and upgrade your current translations in the database. This change
42
-will not be backported into 2.2 or older versions of extensions and will be available in comming
43
-releases.
44
-- **Sortable** now handles and synchronizes all object sort positions which are allready in memory
45
-of unitOfWork. Which does not require to do **$em->clear()** after each operation anymore.
46
-
47
-**2012-03-04**
48
-
49
-- We should be very grateful for contributions of [comfortablynumb](http://github.com/comfortablynumb)
50
-He has contributed most to these extensions and recently - long waited [softdeleteable
51
-behavior](https://github.com/l3pp4rd/DoctrineExtensions/blob/master/doc/softdeleteable.md) for **ORM** users. Also most important, there
52
-was a tree extension missing for **ODM** now everyone can enjoy [materialized path tree strategy](https://github.com/l3pp4rd/DoctrineExtensions/blob/master/doc/tree.md#materialized-path) for **ORM** including.
53
-
54
-**2012-02-26**
55
-
56
-- Removed slug handlers, this functionality brought complications which could not be maintained.
57
-
58
-**2012-02-15**
59
-
60
-- Add option to force **Translatable** store translation in default locale like any other.
61
-See [documentation](http://github.com/l3pp4rd/DoctrineExtensions/blob/master/doc/translatable.md#advanced-examples)
62
-
63
-**2012-01-29**
64
-
65
-- Translatable finally has **Personal Translations** which can relate through a real **foreign key**
66
-constraint and be used as a standard doctrine collection. This allows to configure domain
67
-objects anyway you prefere and still enjoy all features **Translatable** provides.
68
-- There were **BC** breaks introduced in **master** branch of extensions which is
69
-based on **doctrine2.3.x** version. If you are not interested in upgrading you can
70
-safely checkout at **2.2.x** or **2.1.x** [tag](http://github.com/l3pp4rd/DoctrineExtensions/tags).
71
-To upgrade your source code follow the [upgrade guide](https://github.com/l3pp4rd/DoctrineExtensions/blob/master/upgrade/2-3-0.md)
72
-- Library now can map only **MappedSuperclass**es which would avoid generation of **ext_**
73
-tables which might not be used. Also it provides [convinient methods](https://github.com/l3pp4rd/DoctrineExtensions/blob/master/lib/Gedmo/DoctrineExtensions.php#L66)
74
-to hook extension metadata drivers into metadata driver chain.
75
-- [Example demo application](https://github.com/l3pp4rd/DoctrineExtensions/blob/master/example/em.php) has a detailed configuration provided, which
76
-explains and shows how extensions can or should be used with **Doctrine2** ORM. To install
77
-it follow the [steps](#example-demo).
78
-
79 42
 ### Summary and features
80 43
 
81 44
 This package contains extensions for Doctrine2 that hook into the facilities of Doctrine and
@@ -94,6 +57,7 @@ records being flushed in the behavioral way. List of extensions:
94 57
 - **Translator** - explicit way to handle translations
95 58
 - **Softdeleteable** - allows to implicitly remove records
96 59
 - **Uploadable** - provides file upload handling in entity fields
60
+- **References** - supports linking Entities in Documents and visa versa
97 61
 
98 62
 Currently these extensions support **Yaml**, **Annotation**  and **Xml** mapping. Additional mapping drivers
99 63
 can be easily implemented using Mapping extension to handle the additional metadata mapping.
@@ -129,6 +93,7 @@ List of extensions which support ODM
129 93
 - Loggable
130 94
 - Translator
131 95
 - Tree (Materialized Path strategy for now)
96
+- References
132 97
 
133 98
 All these extensions can be nested together and mapped in traditional ways - annotations,
134 99
 xml or yaml

+ 219 - 0
vendor/gedmo/doctrine-extensions/doc/references.md View File

@@ -0,0 +1,219 @@
1
+# Cross Object Mapper References behavior extension for Doctrine 2
2
+
3
+Create documents and entities that contain references to each other.
4
+
5
+## Options
6
+
7
+The following options are possible on reference one and many associations:
8
+
9
+**Owning Side**
10
+
11
+- **type** - The type of association.
12
+- **class** - The associated class name.
13
+- **inversedBy** - The property name for the inverse side of this association.
14
+- **identifier** - The property name to store the associated object id in.
15
+
16
+**Inverse Side**
17
+
18
+- **type** - The type of association.
19
+- **class** - The associated class name.
20
+- **mappedBy** - The property name for the owning side of this association.
21
+
22
+## Annotations
23
+
24
+**@Gedmo\ReferenceOne**
25
+
26
+``` php
27
+<?php
28
+
29
+/**
30
+ * @Gedmo\ReferenceMany(type="entity", class="Entity\StockItem", mappedBy="product")
31
+ */
32
+private $stockItems;
33
+```
34
+
35
+**@Gedmo\ReferenceMany**
36
+
37
+``` php
38
+<?php
39
+
40
+/**
41
+ * @Gedmo\ReferenceOne(type="document", class="Document\Product", inversedBy="stockItems", identifier="productId")
42
+ */
43
+private $product;
44
+```
45
+
46
+## Example
47
+
48
+Here is an example where you have a Product which is mapped using the Doctrine MongoDB ODM project and it contains a property `$stockItems` that is populated from the Doctrine2 ORM.
49
+
50
+``` php
51
+<?php
52
+
53
+namespace Document;
54
+
55
+use Doctrine\Common\Collections\Collection;
56
+use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
57
+use Gedmo\Mapping\Annotation as Gedmo;
58
+
59
+/**
60
+ * @ODM\Document
61
+ */
62
+class Product
63
+{
64
+    /**
65
+     * @ODM\Id
66
+     */
67
+    private $id;
68
+
69
+    /**
70
+     * @ODM\String
71
+     */
72
+    private $name;
73
+
74
+    /**
75
+     * @Gedmo\ReferenceMany(type="entity", class="Entity\StockItem", mappedBy="product")
76
+     */
77
+    private $stockItems;
78
+
79
+    public function getId()
80
+    {
81
+        return $this->id;
82
+    }
83
+
84
+    public function setId($id)
85
+    {
86
+        $this->id = $id;
87
+    }
88
+
89
+    public function getName()
90
+    {
91
+        return $this->name;
92
+    }
93
+
94
+    public function setName($name)
95
+    {
96
+        $this->name = $name;
97
+    }
98
+
99
+    public function getStockItems()
100
+    {
101
+        return $this->stockItems;
102
+    }
103
+
104
+    public function setStockItems(Collection $stockItems)
105
+    {
106
+        $this->stockItems = $stockItems;
107
+    }
108
+}
109
+```
110
+
111
+The `StockItem` has a reference to the `Product` as well.
112
+
113
+``` php
114
+<?php
115
+
116
+namespace Entity;
117
+
118
+use Doctrine\ORM\Mapping as ORM;
119
+use Gedmo\Mapping\Annotation as Gedmo;
120
+use References\Fixture\ODM\MongoDB\Product;
121
+
122
+/**
123
+ * @ORM\Entity
124
+ */
125
+class StockItem
126
+{
127
+    /**
128
+     * @ORM\Id
129
+     * @ORM\Column(type="integer")
130
+     * @ORM\GeneratedValue(strategy="IDENTITY")
131
+     */
132
+    private $id;
133
+
134
+    /**
135
+     * @ORM\Column
136
+     */
137
+    private $name;
138
+
139
+    /**
140
+     * @ORM\Column
141
+     */
142
+    private $sku;
143
+
144
+    /**
145
+     * @ORM\Column(type="integer")
146
+     */
147
+    private $quantity;
148
+
149
+    /**
150
+     * @Gedmo\ReferenceOne(type="document", class="Document\Product", inversedBy="stockItems", identifier="productId")
151
+     */
152
+    private $product;
153
+
154
+    /**
155
+     * @ORM\Column(type="string")
156
+     */
157
+    private $productId;
158
+
159
+    public function getId()
160
+    {
161
+        return $this->id;
162
+    }
163
+
164
+    public function setId($id)
165
+    {
166
+        $this->id = $id;
167
+    }
168
+
169
+    public function getName()
170
+    {
171
+        return $this->name;
172
+    }
173
+
174
+    public function setName($name)
175
+    {
176
+        $this->name = $name;
177
+    }
178
+
179
+    public function getSku()
180
+    {
181
+        return $this->sku;
182
+    }
183
+
184
+    public function setSku($sku)
185
+    {
186
+        $this->sku = $sku;
187
+    }
188
+
189
+    public function getQuantity()
190
+    {
191
+        return $this->quantity;
192
+    }
193
+
194
+    public function setQuantity($quantity)
195
+    {
196
+        $this->quantity = $quantity;
197
+    }
198
+
199
+    public function setProduct(Product $product)
200
+    {
201
+        $this->product = $product;
202
+    }
203
+
204
+    public function getProduct()
205
+    {
206
+        return $this->product;
207
+    }
208
+
209
+    public function setProductId($productId)
210
+    {
211
+        $this->productId = $productId;
212
+    }
213
+
214
+    public function getProductId()
215
+    {
216
+        return $this->productId;
217
+    }
218
+}
219
+```

+ 64 - 2
vendor/gedmo/doctrine-extensions/doc/tree.md View File

@@ -592,7 +592,8 @@ $tree = $repo->buildTree($query->getArrayResult(), $options);
592 592
 
593 593
 ### Using routes in decorator, show only selected items, return unlimited levels items as 2 levels
594 594
 
595
-```
595
+``` php
596
+<?php
596 597
 $controller = $this;
597 598
         $tree = $root->childrenHierarchy(null,false,array('decorate' => true,
598 599
             'rootOpen' => function($tree) {
@@ -812,11 +813,15 @@ Easy like that, any suggestions on improvements are very welcome
812 813
 modifications on the tree could occur. Look at the MongoDB example of schema definition to see how it must be configured.
813 814
 - If your **TreePathSource** field is of type "string", then the primary key will be concatenated in the form: "value-id".
814 815
  This is to allow you to use non-unique values as the path source. For example, this could be very useful if you need to
815
- use the date as the path source (maybe to create a tree of comments and order them by date).
816
+ use the date as the path source (maybe to create a tree of comments and order them by date). If you want to change this 
817
+ default behaviour you can set the attribute "appendId" of **TreePath** to true or false. By default the path does not start
818
+ with the given separator but ends with it. You can customize this behaviour with "startsWithSeparator" and "endsWithSeparator".
819
+ `@Gedmo\TreePath(appendId=false, startsWithSeparator=true, endsWithSeparator=false)`
816 820
 - **TreePath** field can only be of types: string, text
817 821
 - **TreePathSource** field can only be of types: id, integer, smallint, bigint, string, int, float (I include here all the
818 822
 variations of the field types, including the ORM and ODM for MongoDB ones).
819 823
 - **TreeLockTime** must be of type "date" (used only in MongoDB for now).
824
+- **TreePathHash** allows you to define a field that is automatically filled with the md5 hash of the path. This field could be neccessary if you want to set a unique constraint on the database table.
820 825
 
821 826
 ### ORM Entity example (Annotations)
822 827
 
@@ -1009,6 +1014,63 @@ class Category
1009 1014
 
1010 1015
 ```
1011 1016
 
1017
+### MongoDB example (Yaml)
1018
+
1019
+YourNamespace\Document\Category:
1020
+    type:               mappedSuperclass
1021
+    repositoryClass:    Gedmo\Tree\Document\MongoDB\Repository\MaterializedPathRepository
1022
+    collection:         categories
1023
+    gedmo:
1024
+        tree:
1025
+            type: materializedPath
1026
+            activateLocking: true
1027
+    fields:
1028
+        id:
1029
+            id:     true
1030
+        title:
1031
+            type:   string
1032
+            gedmo:
1033
+                -   sluggable
1034
+        slug:
1035
+            type:   string
1036
+            gedmo:
1037
+                0:  treePathSource
1038
+                slug:
1039
+                    unique:     false
1040
+                    fields:
1041
+                        - title
1042
+        path:
1043
+            type:   string
1044
+            gedmo:
1045
+                treePath:
1046
+                    separator:           '/'
1047
+                    appendId:            false
1048
+                    startsWithSeparator: false  # default
1049
+                    endsWithSeparator:   true   # default
1050
+        level:
1051
+            type:   int
1052
+            name:   lvl
1053
+            nullable:   true
1054
+            gedmo:
1055
+                -   treeLevel
1056
+        lockTime:
1057
+            type:   date
1058
+            gedmo:
1059
+                -   treeLockTime
1060
+        hash:
1061
+            type:   string
1062
+            gedmo:
1063
+                -   treePathHash
1064
+        parent:
1065
+            reference:  true
1066
+            type:       one
1067
+            inversedBy: children
1068
+            targetDocument: YourNamespace\Document\Category
1069
+            simple:     true
1070
+            gedmo:
1071
+                -   treeParent
1072
+
1073
+
1012 1074
 ### Path generation
1013 1075
 
1014 1076
 When an entity is inserted, a path is generated using the value of the field configured as the TreePathSource.

+ 1 - 1
vendor/gedmo/doctrine-extensions/lib/Gedmo/Blameable/BlameableListener.php View File

@@ -45,7 +45,7 @@ class BlameableListener extends TimestampableListener
45 45
             if (method_exists($this->user, 'getUsername')) {
46 46
                 return (string)$this->user->getUsername();
47 47
             }
48
-            if (method_exists($this->user, '__toString()')) {
48
+            if (method_exists($this->user, '__toString')) {
49 49
                 return $this->user->__toString();
50 50
             }
51 51
             throw new InvalidArgumentException("Field expects string, user must be a string, or object should have method getUsername or __toString");

+ 25 - 0
vendor/gedmo/doctrine-extensions/lib/Gedmo/Mapping/Annotation/Reference.php View File

@@ -0,0 +1,25 @@
1
+<?php
2
+
3
+namespace Gedmo\Mapping\Annotation;
4
+
5
+use Doctrine\Common\Annotations\Annotation;
6
+
7
+/**
8
+ * Reference annotation for ORM -> ODM references extension
9
+ * to be user like @ReferenceMany(type="entity", class="MyEntity", identifier="entity_id")
10
+ *
11
+ * @author Bulat Shakirzyanov <mallluhuct@gmail.com>
12
+ * @package Gedmo.Mapping.Annotation
13
+ * @subpackage Language
14
+ * @link http://www.gediminasm.org
15
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
16
+ * @Annotation
17
+ */
18
+abstract class Reference extends Annotation
19
+{
20
+    public $type;
21
+    public $class;
22
+    public $identifier;
23
+    public $mappedBy;
24
+    public $inversedBy;
25
+}

+ 21 - 0
vendor/gedmo/doctrine-extensions/lib/Gedmo/Mapping/Annotation/ReferenceMany.php View File

@@ -0,0 +1,21 @@
1
+<?php
2
+
3
+namespace Gedmo\Mapping\Annotation;
4
+
5
+use Doctrine\Common\Annotations\Annotation;
6
+
7
+/**
8
+ * Reference annotation for ORM -> ODM references extension
9
+ * to be user like @ReferenceOne(type="entity", class="MyEntity", identifier="entity_id")
10
+ *
11
+ * @author Bulat Shakirzyanov <mallluhuct@gmail.com>
12
+ * @package Gedmo.Mapping.Annotation
13
+ * @subpackage Language
14
+ * @link http://www.gediminasm.org
15
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
16
+ * @Annotation
17
+ */
18
+class ReferenceMany extends Reference
19
+{
20
+}
21
+

+ 21 - 0
vendor/gedmo/doctrine-extensions/lib/Gedmo/Mapping/Annotation/ReferenceOne.php View File

@@ -0,0 +1,21 @@
1
+<?php
2
+
3
+namespace Gedmo\Mapping\Annotation;
4
+
5
+use Doctrine\Common\Annotations\Annotation;
6
+
7
+/**
8
+ * Reference annotation for ORM -> ODM references extension
9
+ * to be user like @ReferenceOne(type="entity", class="MyEntity", identifier="entity_id")
10
+ *
11
+ * @author Bulat Shakirzyanov <mallluhuct@gmail.com>
12
+ * @package Gedmo.Mapping.Annotation
13
+ * @subpackage Language
14
+ * @link http://www.gediminasm.org
15
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
16
+ * @Annotation
17
+ */
18
+class ReferenceOne extends Reference
19
+{
20
+}
21
+

+ 7 - 0
vendor/gedmo/doctrine-extensions/lib/Gedmo/Mapping/Annotation/TreePath.php View File

@@ -12,6 +12,7 @@ use Doctrine\Common\Annotations\Annotation;
12 12
  *
13 13
  * @author Gustavo Falco <comfortablynumb84@gmail.com>
14 14
  * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
15
+ * @author <rocco@roccosportal.com>
15 16
  * @package Gedmo.Mapping.Annotation
16 17
  * @subpackage TreePath
17 18
  * @link http://www.gediminasm.org
@@ -20,5 +21,11 @@ use Doctrine\Common\Annotations\Annotation;
20 21
 final class TreePath extends Annotation
21 22
 {
22 23
     public $separator = ',';
24
+
25
+    public $appendId = null;
26
+
27
+    public $startsWithSeparator = false;
28
+
29
+    public $endsWithSeparator = true;
23 30
 }
24 31
 

+ 22 - 0
vendor/gedmo/doctrine-extensions/lib/Gedmo/Mapping/Annotation/TreePathHash.php View File

@@ -0,0 +1,22 @@
1
+<?php
2
+
3
+namespace Gedmo\Mapping\Annotation;
4
+
5
+use Doctrine\Common\Annotations\Annotation;
6
+
7
+/**
8
+ * TreePath annotation for Tree behavioral extension
9
+ *
10
+ * @Annotation
11
+ * @Target("PROPERTY")
12
+ *
13
+ * @author <rocco@roccosportal.com>
14
+ * @package Gedmo.Mapping.Annotation
15
+ * @subpackage TreePathHash
16
+ * @link http://www.gediminasm.org
17
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
18
+ */
19
+final class TreePathHash extends Annotation
20
+{
21
+
22
+}

+ 215 - 0
vendor/gedmo/doctrine-extensions/lib/Gedmo/References/LazyCollection.php View File

@@ -0,0 +1,215 @@
1
+<?php
2
+
3
+namespace Gedmo\References;
4
+
5
+use Doctrine\Common\Collections\ArrayCollection;
6
+
7
+use Doctrine\Common\Collections\Collection;
8
+
9
+/**
10
+ * Lazy collection for loading reference many associations.
11
+ *
12
+ * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
13
+ * @author Bulat Shakirzyanov <mallluhuct@gmail.com>
14
+ * @author Jonathan H. Wage <jonwage@gmail.com>
15
+ * @package Gedmo\References\Mapping\Event
16
+ * @link http://www.gediminasm.org
17
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
18
+ */
19
+class LazyCollection implements Collection
20
+{
21
+    private $results;
22
+    private $callback;
23
+
24
+    public function __construct($callback)
25
+    {
26
+        $this->callback = $callback;
27
+    }
28
+
29
+    public function add($element)
30
+    {
31
+        $this->initialize();
32
+        return $this->results->add($element);
33
+    }
34
+
35
+    public function clear()
36
+    {
37
+        $this->initialize();
38
+        return $this->results->clear();
39
+    }
40
+
41
+    public function contains($element)
42
+    {
43
+        $this->initialize();
44
+        return $this->results->contains($element);
45
+    }
46
+
47
+    public function containsKey($key)
48
+    {
49
+        $this->initialize();
50
+        return $this->results->containsKey($key);
51
+    }
52
+
53
+    public function current()
54
+    {
55
+        $this->initialize();
56
+        return $this->results->current();
57
+    }
58
+
59
+    public function exists(\Closure $p)
60
+    {
61
+        $this->initialize();
62
+        return $this->results->exists($p);
63
+    }
64
+
65
+    public function filter(\Closure $p)
66
+    {
67
+        $this->initialize();
68
+        return $this->results->filter($p);
69
+    }
70
+
71
+    public function first()
72
+    {
73
+        $this->initialize();
74
+        return $this->results->first();
75
+    }
76
+
77
+    public function forAll(\Closure $p)
78
+    {
79
+        $this->initialize();
80
+        return $this->results->forAll($p);
81
+    }
82
+
83
+    public function get($key)
84
+    {
85
+        $this->initialize();
86
+        return $this->results->get($key);
87
+    }
88
+
89
+    public function getKeys()
90
+    {
91
+        $this->initialize();
92
+        return $this->results->getKeys();
93
+    }
94
+
95
+    public function getValues()
96
+    {
97
+        $this->initialize();
98
+        return $this->results->getValues();
99
+    }
100
+
101
+    public function indexOf($element)
102
+    {
103
+        $this->initialize();
104
+        return $this->results->indexOf($element);
105
+    }
106
+
107
+    public function isEmpty()
108
+    {
109
+        $this->initialize();
110
+        return $this->results->isEmpty();
111
+    }
112
+
113
+    public function key()
114
+    {
115
+        $this->initialize();
116
+        return $this->results->key();
117
+    }
118
+
119
+    public function last()
120
+    {
121
+        $this->initialize();
122
+        return $this->results->last();
123
+    }
124
+
125
+    public function map(\Closure $func)
126
+    {
127
+        $this->initialize();
128
+        return $this->results->map($func);
129
+    }
130
+
131
+    public function next()
132
+    {
133
+        $this->initialize();
134
+        return $this->results->next();
135
+    }
136
+
137
+    public function partition(\Closure $p)
138
+    {
139
+        $this->initialize();
140
+        return $this->results->partition($p);
141
+    }
142
+
143
+    public function remove($key)
144
+    {
145
+        $this->initialize();
146
+        return $this->results->remove($key);
147
+    }
148
+
149
+    public function removeElement($element)
150
+    {
151
+        $this->initialize();
152
+        return $this->results->removeElement($element);
153
+    }
154
+
155
+    public function set($key, $value)
156
+    {
157
+        $this->initialize();
158
+        return $this->results->set($key, $value);
159
+    }
160
+
161
+    public function slice($offset, $length = null)
162
+    {
163
+        $this->initialize();
164
+        return $this->results->slice($offset, $length);
165
+    }
166
+
167
+    public function toArray()
168
+    {
169
+        $this->initialize();
170
+        return $this->results->toArray();
171
+    }
172
+
173
+    public function offsetExists($offset)
174
+    {
175
+        $this->initialize();
176
+        return $this->results->offsetExists($offset);
177
+    }
178
+
179
+    public function offsetGet($offset)
180
+    {
181
+        $this->initialize();
182
+        return $this->results->offsetGet($offset);
183
+    }
184
+
185
+    public function offsetSet($offset, $value)
186
+    {
187
+        $this->initialize();
188
+        return $this->results->offsetSet($offset, $value);
189
+    }
190
+
191
+    public function offsetUnset($offset)
192
+    {
193
+        $this->initialize();
194
+        return $this->results->offsetUnset($offset);
195
+    }
196
+
197
+    public function getIterator()
198
+    {
199
+        $this->initialize();
200
+        return $this->results->getIterator();
201
+    }
202
+
203
+    public function count()
204
+    {
205
+        $this->initialize();
206
+        return $this->results->count();
207
+    }
208
+
209
+    private function initialize()
210
+    {
211
+        if (null === $this->results) {
212
+            $this->results = call_user_func($this->callback);
213
+        }
214
+    }
215
+}

+ 99 - 0
vendor/gedmo/doctrine-extensions/lib/Gedmo/References/Mapping/Driver/Annotation.php View File

@@ -0,0 +1,99 @@
1
+<?php
2
+
3
+namespace Gedmo\References\Mapping\Driver;
4
+
5
+use Gedmo\Mapping\Driver\AnnotationDriverInterface,
6
+    Doctrine\Common\Annotations\AnnotationReader,
7
+    Doctrine\Common\Persistence\Mapping\ClassMetadata,
8
+    Gedmo\Exception\InvalidMappingException;
9
+
10
+/**
11
+ * This is an annotation mapping driver for References
12
+ * behavioral extension.
13
+ *
14
+ * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
15
+ * @author Bulat Shakirzyanov <mallluhuct@gmail.com>
16
+ * @author Jonathan H. Wage <jonwage@gmail.com>
17
+ * @package Gedmo.References.Mapping.Driver
18
+ * @subpackage Annotation
19
+ * @link http://www.gediminasm.org
20
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
21
+ */
22
+class Annotation implements AnnotationDriverInterface
23
+{
24
+    /**
25
+     * Annotation to mark field as reference to one
26
+     */
27
+    const REFERENCE_ONE = 'Gedmo\\Mapping\\Annotation\\ReferenceOne';
28
+
29
+    /**
30
+     * Annotation to mark field as reference to many
31
+     */
32
+    const REFERENCE_MANY = 'Gedmo\\Mapping\\Annotation\\ReferenceMany';
33
+
34
+    private $annotations = array(
35
+        'referenceOne'  => self::REFERENCE_ONE,
36
+        'referenceMany' => self::REFERENCE_MANY,
37
+    );
38
+
39
+    /**
40
+     * Annotation reader instance
41
+     *
42
+     * @var object
43
+     */
44
+    private $reader;
45
+
46
+    /**
47
+     * original driver if it is available
48
+     */
49
+    protected $_originalDriver = null;
50
+
51
+    /**
52
+     * {@inheritDoc}
53
+     */
54
+    public function setAnnotationReader($reader)
55
+    {
56
+        $this->reader = $reader;
57
+    }
58
+
59
+    /**
60
+     * {@inheritDoc}
61
+     */
62
+    public function readExtendedMetadata($meta, array &$config)
63
+    {
64
+        $class = $meta->getReflectionClass();
65
+        foreach($this->annotations as $key => $annotation) {
66
+            $config[$key] = array();
67
+            foreach ($class->getProperties() as $property) {
68
+                if ($meta->isMappedSuperclass && !$property->isPrivate() ||
69
+                    $meta->isInheritedField($property->name) ||
70
+                    isset($meta->associationMappings[$property->name]['inherited'])
71
+                ) {
72
+                    continue;
73
+                }
74
+
75
+                if ($reference = $this->reader->getPropertyAnnotation($property, $annotation)) {
76
+                    $config[$key][$property->getName()] = array(
77
+                        'field'      => $property->getName(),
78
+                        'type'       => $reference->type,
79
+                        'class'      => $reference->class,
80
+                        'identifier' => $reference->identifier,
81
+                        'mappedBy'   => $reference->mappedBy,
82
+                        'inversedBy' => $reference->inversedBy,
83
+                    );
84
+                }
85
+            }
86
+        }
87
+    }
88
+
89
+    /**
90
+     * Passes in the mapping read by original driver
91
+     *
92
+     * @param $driver
93
+     * @return void
94
+     */
95
+    public function setOriginalDriver($driver)
96
+    {
97
+        $this->_originalDriver = $driver;
98
+    }
99
+}

+ 99 - 0
vendor/gedmo/doctrine-extensions/lib/Gedmo/References/Mapping/Event/Adapter/ODM.php View File

@@ -0,0 +1,99 @@
1
+<?php
2
+
3
+namespace Gedmo\References\Mapping\Event\Adapter;
4
+
5
+use Doctrine\Common\Persistence\ObjectManager;
6
+use Doctrine\ODM\MongoDB\DocumentManager;
7
+use Doctrine\ODM\MongoDB\Proxy\Proxy as MongoDBProxy;
8
+use Doctrine\ORM\EntityManager;
9
+use Doctrine\ORM\Proxy\Proxy as ORMProxy;
10
+use Gedmo\Exception\InvalidArgumentException;
11
+use Gedmo\Mapping\Event\Adapter\ODM as BaseAdapterODM;
12
+use Gedmo\References\Mapping\Event\ReferencesAdapter;
13
+
14
+/**
15
+ * Doctrine event adapter for ODM references behavior
16
+ *
17
+ * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
18
+ * @author Bulat Shakirzyanov <mallluhuct@gmail.com>
19
+ * @author Jonathan H. Wage <jonwage@gmail.com>
20
+ * @package Gedmo\References\Mapping\Event\Adapter
21
+ * @subpackage ODM
22
+ * @link http://www.gediminasm.org
23
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
24
+ */
25
+final class ODM extends BaseAdapterODM implements ReferencesAdapter
26
+{
27
+    /**
28
+     * @inheritDoc
29
+     */
30
+    public function getIdentifier($om, $object, $single = true)
31
+    {
32
+        if ($om instanceof DocumentManager) {
33
+            return $this->extractIdentifier($om, $object, $single);
34
+        }
35
+
36
+        if ($om instanceof EntityManager) {
37
+            if ($object instanceof ORMProxy) {
38
+                $id = $om->getUnitOfWork()->getEntityIdentifier($object);
39
+            } else {
40
+                $meta = $om->getClassMetadata(get_class($object));
41
+                $id = array();
42
+                foreach ($meta->identifier as $name) {
43
+                    $id[$name] = $meta->getReflectionProperty($name)->getValue($object);
44
+                    // return null if one of identifiers is missing
45
+                    if (!$id[$name]) {
46
+                        return null;
47
+                    }
48
+                }
49
+            }
50
+
51
+            if ($single) {
52
+                $id = current($id);
53
+            }
54
+
55
+            return $id;
56
+        }
57
+    }
58
+
59
+    /**
60
+     * @inheritDoc
61
+     */
62
+    public function getSingleReference($om, $class, $identifier)
63
+    {
64
+        $this->throwIfNotEntityManager($om);
65
+        $meta = $om->getClassMetadata($class);
66
+
67
+        if (!$meta->isInheritanceTypeNone()) {
68
+            return $om->find($class, $identifier);
69
+        }
70
+
71
+        return $om->getReference($class, $identifier);
72
+    }
73
+
74
+    /**
75
+     * @inheritDoc
76
+     */
77
+    public function extractIdentifier($om, $object, $single = true)
78
+    {
79
+        $meta = $om->getClassMetadata(get_class($object));
80
+        if ($object instanceof MongoDBProxy) {
81
+            $id = $om->getUnitOfWork()->getDocumentIdentifier($object);
82
+        } else {
83
+            $id = $meta->getReflectionProperty($meta->identifier)->getValue($object);
84
+        }
85
+
86
+        if ($single || !$id) {
87
+            return $id;
88
+        } else {
89
+            return array($meta->identifier => $id);
90
+        }
91
+    }
92
+
93
+    /**
94
+     * Override so we don't get an exception. We want to allow this.
95
+     */
96
+    private function throwIfNotEntityManager(EntityManager $em)
97
+    {
98
+    }
99
+}

+ 98 - 0
vendor/gedmo/doctrine-extensions/lib/Gedmo/References/Mapping/Event/Adapter/ORM.php View File

@@ -0,0 +1,98 @@
1
+<?php
2
+
3
+namespace Gedmo\References\Mapping\Event\Adapter;
4
+
5
+use Doctrine\Common\Persistence\ObjectManager;
6
+use Doctrine\ODM\MongoDB\DocumentManager;
7
+use Doctrine\ODM\MongoDB\Proxy\Proxy as MongoDBProxy;
8
+use Doctrine\ORM\EntityManager;
9
+use Doctrine\ORM\Proxy\Proxy as ORMProxy;
10
+use Gedmo\Mapping\Event\Adapter\ORM as BaseAdapterORM;
11
+use Gedmo\References\Mapping\Event\ReferencesAdapter;
12
+
13
+/**
14
+ * Doctrine event adapter for ORM references behavior
15
+ *
16
+ * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
17
+ * @author Bulat Shakirzyanov <mallluhuct@gmail.com>
18
+ * @author Jonathan H. Wage <jonwage@gmail.com>
19
+ * @package Gedmo\References\Mapping\Event\Adapter
20
+ * @subpackage ORM
21
+ * @link http://www.gediminasm.org
22
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
23
+ */
24
+final class ORM extends BaseAdapterORM implements ReferencesAdapter
25
+{
26
+    /**
27
+     * @inheritDoc
28
+     */
29
+    public function getIdentifier($om, $object, $single = true)
30
+    {
31
+        if ($om instanceof EntityManager) {
32
+            return $this->extractIdentifier($om, $object, $single);
33
+        }
34
+
35
+        if ($om instanceof DocumentManager) {
36
+            $meta = $om->getClassMetadata(get_class($object));
37
+            if ($object instanceof MongoDBProxy) {
38
+                $id = $om->getUnitOfWork()->getDocumentIdentifier($object);
39
+            } else {
40
+                $id = $meta->getReflectionProperty($meta->identifier)->getValue($object);
41
+            }
42
+
43
+            if ($single || !$id) {
44
+                return $id;
45
+            }
46
+
47
+            return array($meta->identifier => $id);
48
+        }
49
+    }
50
+
51
+    /**
52
+     * @inheritDoc
53
+     */
54
+    public function getSingleReference($om, $class, $identifier)
55
+    {
56
+        $this->throwIfNotDocumentManager($om);
57
+        $meta = $om->getClassMetadata($class);
58
+
59
+        if (!$meta->isInheritanceTypeNone()) {
60
+            return $om->find($class, $identifier);
61
+        }
62
+
63
+        return $om->getReference($class, $identifier);
64
+    }
65
+
66
+    /**
67
+     * @inheritDoc
68
+     */
69
+    public function extractIdentifier($om, $object, $single = true)
70
+    {
71
+        if ($object instanceof ORMProxy) {
72
+            $id = $om->getUnitOfWork()->getEntityIdentifier($object);
73
+        } else {
74
+            $meta = $om->getClassMetadata(get_class($object));
75
+            $id = array();
76
+            foreach ($meta->identifier as $name) {
77
+                $id[$name] = $meta->getReflectionProperty($name)->getValue($object);
78
+                // return null if one of identifiers is missing
79
+                if (!$id[$name]) {
80
+                    return null;
81
+                }
82
+            }
83
+        }
84
+
85
+        if ($single) {
86
+            $id = current($id);
87
+        }
88
+
89
+        return $id;
90
+    }
91
+
92
+    /**
93
+     * Override so we don't get an exception. We want to allow this.
94
+     */
95
+    private function throwIfNotDocumentManager(DocumentManager $dm)
96
+    {
97
+    }
98
+}

+ 50 - 0
vendor/gedmo/doctrine-extensions/lib/Gedmo/References/Mapping/Event/ReferencesAdapter.php View File

@@ -0,0 +1,50 @@
1
+<?php
2
+
3
+namespace Gedmo\References\Mapping\Event;
4
+
5
+use Doctrine\Common\Persistence\Mapping\ClassMetadata;
6
+use Doctrine\Common\Persistence\ObjectManager;
7
+use Gedmo\Mapping\Event\AdapterInterface;
8
+
9
+/**
10
+ * Doctrine event adapter interface for References behavior
11
+ *
12
+ * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
13
+ * @author Bulat Shakirzyanov <mallluhuct@gmail.com>
14
+ * @author Jonathan H. Wage <jonwage@gmail.com>
15
+ * @package Gedmo\References\Mapping\Event
16
+ * @subpackage ReferencesAdapter
17
+ * @link http://www.gediminasm.org
18
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
19
+ */
20
+interface ReferencesAdapter extends AdapterInterface
21
+{
22
+    /**
23
+     * Gets the identifier of the given object using the passed ObjectManager.
24
+     *
25
+     * @param ObjectManager $om
26
+     * @param object $object
27
+     * @param bool $single
28
+     * @return array|scalar $id - array or single identifier
29
+     */
30
+    function getIdentifier($om, $object, $single = true);
31
+
32
+    /**
33
+     * Gets a single reference for the given ObjectManager, class and identifier.
34
+     *
35
+     * @param ObjectManager $om
36
+     * @param string $class
37
+     * @param array|scalar $identifier
38
+     **/
39
+    function getSingleReference($om, $class, $identifier);
40
+
41
+    /**
42
+     * Extracts identifiers from object or proxy.
43
+     *
44
+     * @param DocumentManager $om
45
+     * @param object $object
46
+     * @param bool $single
47
+     * @return array|scalar - array or single identifier
48
+     */
49
+    function extractIdentifier($om, $object, $single = true);
50
+}

+ 158 - 0
vendor/gedmo/doctrine-extensions/lib/Gedmo/References/ReferencesListener.php View File

@@ -0,0 +1,158 @@
1
+<?php
2
+
3
+namespace Gedmo\References;
4
+
5
+use Doctrine\Common\Collections\ArrayCollection;
6
+use Doctrine\Common\EventArgs;
7
+use Doctrine\ORM\Mapping\ClassMetadata as ORMClassMetadata;
8
+use Doctrine\ORM\EntityManager;
9
+use Doctrine\ODM\MongoDB\DocumentManager;
10
+use Doctrine\ODM\MongoDB\Mapping\ClassMetadata as MongoDBClassMetadata;
11
+use Gedmo\Exception\InvalidArgumentException;
12
+use Gedmo\Mapping\MappedEventSubscriber;
13
+
14
+/**
15
+ * Listener for loading and persisting cross database references.
16
+ *
17
+ * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
18
+ * @author Bulat Shakirzyanov <mallluhuct@gmail.com>
19
+ * @author Jonathan H. Wage <jonwage@gmail.com>
20
+ * @package Gedmo\References\Mapping\Event
21
+ * @subpackage MappedEventSubscriber
22
+ * @link http://www.gediminasm.org
23
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
24
+ */
25
+class ReferencesListener extends MappedEventSubscriber
26
+{
27
+    private $managers;
28
+
29
+    public function __construct(array $managers = array())
30
+    {
31
+        $this->managers = $managers;
32
+    }
33
+
34
+    public function loadClassMetadata(EventArgs $eventArgs)
35
+    {
36
+        $ea = $this->getEventAdapter($eventArgs);
37
+        $this->loadMetadataForObjectClass(
38
+            $ea->getObjectManager(), $eventArgs->getClassMetadata()
39
+        );
40
+    }
41
+
42
+    public function postLoad(EventArgs $eventArgs)
43
+    {
44
+        $ea = $this->getEventAdapter($eventArgs);
45
+        $om = $ea->getObjectManager();
46
+        $object = $ea->getObject();
47
+        $meta = $om->getClassMetadata(get_class($object));
48
+        $config = $this->getConfiguration($om, $meta->name);
49
+        foreach ($config['referenceOne'] as $mapping) {
50
+            $property = $meta->reflClass->getProperty($mapping['field']);
51
+            $property->setAccessible(true);
52
+            if (isset($mapping['identifier'])) {
53
+                $referencedObjectId = $meta->getFieldValue($object, $mapping['identifier']);
54
+                if (null !== $referencedObjectId) {
55
+                    $property->setValue(
56
+                        $object,
57
+                        $ea->getSingleReference(
58
+                            $this->getManager($mapping['type']),
59
+                            $mapping['class'],
60
+                            $referencedObjectId
61
+                        )
62
+                    );
63
+                }
64
+            }
65
+        }
66
+
67
+        foreach ($config['referenceMany'] as $mapping) {
68
+            $property = $meta->reflClass->getProperty($mapping['field']);
69
+            $property->setAccessible(true);
70
+            if (isset($mapping['mappedBy'])) {
71
+                $id = $ea->extractIdentifier($om, $object);
72
+                $manager = $this->getManager($mapping['type']);
73
+                $class = $mapping['class'];
74
+                $refMeta = $manager->getClassMetadata($class);
75
+                $refConfig = $this->getConfiguration($manager, $refMeta->name);
76
+                if (isset($refConfig['referenceOne'][$mapping['mappedBy']])) {
77
+                    $refMapping = $refConfig['referenceOne'][$mapping['mappedBy']];
78
+                    $identifier = $refMapping['identifier'];
79
+                    $property->setValue(
80
+                        $object,
81
+                        new LazyCollection(
82
+                            function() use ($id, &$manager, $class, $identifier) {
83
+                                $results = $manager
84
+                                    ->getRepository($class)
85
+                                    ->findBy(array(
86
+                                        $identifier => $id,
87
+                                    ));
88
+
89
+                                return new ArrayCollection((is_array($results) ? $results : $results->toArray()));
90
+                            }
91
+                        )
92
+                    );
93
+                }
94
+            }
95
+        }
96
+    }
97
+
98
+    public function prePersist(EventArgs $eventArgs)
99
+    {
100
+        $this->updateReferences($eventArgs);
101
+    }
102
+
103
+    public function preUpdate(EventArgs $eventArgs)
104
+    {
105
+        $this->updateReferences($eventArgs);
106
+    }
107
+
108
+    public function getSubscribedEvents()
109
+    {
110
+        return array(
111
+            'postLoad',
112
+            'loadClassMetadata',
113
+            'prePersist',
114
+            'preUpdate',
115
+        );
116
+    }
117
+
118
+    public function registerManager($type, $manager)
119
+    {
120
+        $this->managers[$type] = $manager;
121
+    }
122
+
123
+    public function getManager($type)
124
+    {
125
+        return $this->managers[$type];
126
+    }
127
+
128
+    protected function getNamespace()
129
+    {
130
+        return __NAMESPACE__;
131
+    }
132
+
133
+    private function updateReferences(EventArgs $eventArgs)
134
+    {
135
+        $ea = $this->getEventAdapter($eventArgs);
136
+        $om = $ea->getObjectManager();
137
+        $object = $ea->getObject();
138
+        $meta = $om->getClassMetadata(get_class($object));
139
+        $config = $this->getConfiguration($om, $meta->name);
140
+        foreach ($config['referenceOne'] as $mapping) {
141
+            if (isset($mapping['identifier'])) {
142
+                $property = $meta->reflClass->getProperty($mapping['field']);
143
+                $property->setAccessible(true);
144
+                $referencedObject = $property->getValue($object);
145
+                if (is_object($referencedObject)) {
146
+                    $meta->setFieldValue(
147
+                        $object,
148
+                        $mapping['identifier'],
149
+                        $ea->getIdentifier(
150
+                            $this->getManager($mapping['type']),
151
+                            $referencedObject
152
+                        )
153
+                    );
154
+                }
155
+            }
156
+        }
157
+    }
158
+}

+ 1 - 0
vendor/gedmo/doctrine-extensions/lib/Gedmo/SoftDeleteable/Mapping/Validator.php View File

@@ -27,6 +27,7 @@ class Validator
27 27
         'date',
28 28
         'time',
29 29
         'datetime',
30
+        'datetimetz',
30 31
         'timestamp',
31 32
         'zenddate'
32 33
     );

+ 7 - 3
vendor/gedmo/doctrine-extensions/lib/Gedmo/Sortable/SortableListener.php View File

@@ -123,8 +123,10 @@ class SortableListener extends MappedEventSubscriber
123 123
     private function processInsert($em, $config, $meta, $object)
124 124
     {
125 125
         $uow = $em->getUnitOfWork();
126
-
126
+        
127
+        $old = $meta->getReflectionProperty($config['position'])->getValue($object);
127 128
         $newPosition = $meta->getReflectionProperty($config['position'])->getValue($object);
129
+        
128 130
         if (is_null($newPosition)) {
129 131
             $newPosition = -1;
130 132
         }
@@ -168,8 +170,10 @@ class SortableListener extends MappedEventSubscriber
168 170
         call_user_func_array(array($this, 'addRelocation'), $relocation);
169 171
 
170 172
         // Set new position
171
-        $meta->getReflectionProperty($config['position'])->setValue($object, $newPosition);
172
-        $uow->recomputeSingleEntityChangeSet($meta, $object);
173
+        if ($old < 0 || is_null($old)) {
174
+            $meta->getReflectionProperty($config['position'])->setValue($object, $newPosition);
175
+            $uow->recomputeSingleEntityChangeSet($meta, $object);
176
+        }
173 177
     }
174 178
 
175 179
     /**

+ 1 - 0
vendor/gedmo/doctrine-extensions/lib/Gedmo/Timestampable/Mapping/Driver/Annotation.php View File

@@ -34,6 +34,7 @@ class Annotation extends AbstractAnnotationDriver
34 34
         'date',
35 35
         'time',
36 36
         'datetime',
37
+        'datetimetz',
37 38
         'timestamp',
38 39
         'zenddate',
39 40
         'vardatetime',

+ 1 - 0
vendor/gedmo/doctrine-extensions/lib/Gedmo/Timestampable/Mapping/Driver/Xml.php View File

@@ -30,6 +30,7 @@ class Xml extends BaseXml
30 30
         'date',
31 31
         'time',
32 32
         'datetime',
33
+        'datetimetz',
33 34
         'timestamp',
34 35
         'zenddate',
35 36
         'vardatetime',

+ 1 - 0
vendor/gedmo/doctrine-extensions/lib/Gedmo/Timestampable/Mapping/Driver/Yaml.php View File

@@ -35,6 +35,7 @@ class Yaml extends File implements Driver
35 35
         'date',
36 36
         'time',
37 37
         'datetime',
38
+        'datetimetz',
38 39
         'timestamp',
39 40
         'zenddate',
40 41
         'vardatetime',

+ 5 - 5
vendor/gedmo/doctrine-extensions/lib/Gedmo/Tool/Wrapper/EntityWrapper.php View File

@@ -68,7 +68,7 @@ class EntityWrapper extends AbstractWrapper
68 68
      */
69 69
     public function hasValidIdentifier()
70 70
     {
71
-        return (bool)$this->getIdentifier();
71
+        return (null !== $this->getIdentifier());
72 72
     }
73 73
 
74 74
     /**
@@ -84,7 +84,7 @@ class EntityWrapper extends AbstractWrapper
84 84
      */
85 85
     public function getIdentifier($single = true)
86 86
     {
87
-        if (!$this->identifier) {
87
+        if (null === $this->identifier) {
88 88
             if ($this->object instanceof Proxy) {
89 89
                 $uow = $this->om->getUnitOfWork();
90 90
                 if ($uow->isInIdentityMap($this->object)) {
@@ -93,12 +93,12 @@ class EntityWrapper extends AbstractWrapper
93 93
                     $this->initialize();
94 94
                 }
95 95
             }
96
-            if (!$this->identifier) {
96
+            if (null === $this->identifier) {
97 97
                 $this->identifier = array();
98 98
                 $incomplete = false;
99 99
                 foreach ($this->meta->identifier as $name) {
100 100
                     $this->identifier[$name] = $this->getPropertyValue($name);
101
-                    if (!$this->identifier[$name]) {
101
+                    if (null === $this->identifier[$name]) {
102 102
                         $incomplete = true;
103 103
                     }
104 104
                 }
@@ -128,4 +128,4 @@ class EntityWrapper extends AbstractWrapper
128 128
             }
129 129
         }
130 130
     }
131
-}
131
+}

+ 1 - 2
vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/TranslatableListener.php View File

@@ -589,12 +589,11 @@ class TranslatableListener extends MappedEventSubscriber
589 589
 
590 590
             if ($translation) {
591 591
                 // set the translated field, take value using reflection
592
-                $value = $wrapped->getPropertyValue($field);
593 592
                 $content = $ea->getTranslationValue($object, $field);
594 593
                 $translation->setContent($content);
595 594
                 // check if need to update in database
596 595
                 $transWrapper = AbstractWrapper::wrap($translation, $om);
597
-                if ((is_bool($content) || is_int($content) || !empty($content)) && ($isInsert || !$transWrapper->getIdentifier() || isset($changeSet[$field]))) {
596
+                if ((is_bool($content) || is_int($content) || (is_string($content) && strlen($content) > 0) || !empty($content)) && ($isInsert || !$transWrapper->getIdentifier() || isset($changeSet[$field]))) {
598 597
                     if ($isInsert && !$objectId && !$ea->usesPersonalTranslation($translationClass)) {
599 598
                         // if we do not have the primary key yet available
600 599
                         // keep this translation in memory to insert it later with foreign key

+ 22 - 0
vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Mapping/Driver/Annotation.php View File

@@ -13,6 +13,7 @@ use Gedmo\Mapping\Driver\AbstractAnnotationDriver,
13 13
  * extension.
14 14
  *
15 15
  * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
16
+ * @author <rocco@roccosportal.com>
16 17
  * @package Gedmo.Tree.Mapping.Driver
17 18
  * @subpackage Annotation
18 19
  * @link http://www.gediminasm.org
@@ -66,6 +67,11 @@ class Annotation extends AbstractAnnotationDriver
66 67
     const PATH_SOURCE = 'Gedmo\\Mapping\\Annotation\\TreePathSource';
67 68
 
68 69
     /**
70
+     * Annotation to specify path hash class
71
+     */
72
+    const PATH_HASH = 'Gedmo\\Mapping\\Annotation\\TreePathHash';
73
+
74
+    /**
69 75
      * Annotation to mark the field to be used to hold the lock time
70 76
      */
71 77
     const LOCK_TIME = 'Gedmo\\Mapping\\Annotation\\TreeLockTime';
@@ -183,6 +189,9 @@ class Annotation extends AbstractAnnotationDriver
183 189
                 }
184 190
                 $config['path'] = $field;
185 191
                 $config['path_separator'] = $pathAnnotation->separator;
192
+                $config['path_append_id'] = $pathAnnotation->appendId;
193
+                $config['path_starts_with_separator'] = $pathAnnotation->startsWithSeparator;
194
+                $config['path_ends_with_separator'] = $pathAnnotation->endsWithSeparator;
186 195
             }
187 196
             // path source
188 197
             if ($this->reader->getPropertyAnnotation($property, self::PATH_SOURCE)) {
@@ -195,6 +204,19 @@ class Annotation extends AbstractAnnotationDriver
195 204
                 }
196 205
                 $config['path_source'] = $field;
197 206
             }
207
+
208
+             // path hash
209
+            if ($this->reader->getPropertyAnnotation($property, self::PATH_HASH)) {
210
+                $field = $property->getName();
211
+                if (!$meta->hasField($field)) {
212
+                    throw new InvalidMappingException("Unable to find 'path_hash' - [{$field}] as mapped property in entity - {$meta->name}");
213
+                }
214
+                if (!$validator->isValidFieldForPathHash($meta, $field)) {
215
+                    throw new InvalidMappingException("Tree PathHash field - [{$field}] type is not valid. It can be any of the integer variants, double, float or string in class - {$meta->name}");
216
+                }
217
+                $config['path_hash'] = $field;
218
+
219
+            }
198 220
             // lock time
199 221
 
200 222
             if ($this->reader->getPropertyAnnotation($property, self::LOCK_TIME)) {

+ 27 - 0
vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Mapping/Driver/Yaml.php View File

@@ -111,13 +111,40 @@ class Yaml extends File implements Driver
111 111
                         if (strlen($separator) > 1) {
112 112
                             throw new InvalidMappingException("Tree Path field - [{$field}] Separator {$separator} is invalid. It must be only one character long.");
113 113
                         }
114
+
115
+                        if (is_array($treePathInfo) && isset($treePathInfo['appendId'])) {
116
+                            $appendId = $treePathInfo['appendId'];
117
+                        } else {
118
+                            $appendId = null;
119
+                        }
120
+
121
+                        if (is_array($treePathInfo) && isset($treePathInfo['startsWithSeparator'])) {
122
+                            $startsWithSeparator = $treePathInfo['startsWithSeparator'];
123
+                        } else {
124
+                            $startsWithSeparator = false;
125
+                        }
126
+
127
+                        if (is_array($treePathInfo) && isset($treePathInfo['endsWithSeparator'])) {
128
+                            $endsWithSeparator = $treePathInfo['endsWithSeparator'];
129
+                        } else {
130
+                            $endsWithSeparator = true;
131
+                        }
132
+
114 133
                         $config['path'] = $field;
115 134
                         $config['path_separator'] = $separator;
135
+                        $config['path_append_id'] = $appendId;
136
+                        $config['path_starts_with_separator'] = $startsWithSeparator;
137
+                        $config['path_ends_with_separator'] = $endsWithSeparator;
116 138
                     } elseif (in_array('treePathSource', $fieldMapping['gedmo'])) {
117 139
                         if (!$validator->isValidFieldForPathSource($meta, $field)) {
118 140
                             throw new InvalidMappingException("Tree PathSource field - [{$field}] type is not valid. It can be any of the integer variants, double, float or string in class - {$meta->name}");
119 141
                         }
120 142
                         $config['path_source'] = $field;
143
+                    } elseif (in_array('treePathHash', $fieldMapping['gedmo'])) {
144
+                        if (!$validator->isValidFieldForPathSource($meta, $field)) {
145
+                            throw new InvalidMappingException("Tree PathHash field - [{$field}] type is not valid and must be 'string' in class - {$meta->name}");
146
+                        }
147
+                        $config['path_hash'] = $field;
121 148
                     } elseif (in_array('treeLockTime', $fieldMapping['gedmo'])) {
122 149
                         if (!$validator->isValidFieldForLocktime($meta, $field)) {
123 150
                             throw new InvalidMappingException("Tree LockTime field - [{$field}] type is not valid. It must be \"date\" in class - {$meta->name}");

+ 24 - 3
vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Mapping/Validator.php View File

@@ -11,12 +11,13 @@ use Gedmo\Exception\InvalidMappingException;
11 11
  *
12 12
  * @author Gustavo Falco <comfortablynumb84@gmail.com>
13 13
  * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
14
+ * @author <rocco@roccosportal.com>
14 15
  * @package Gedmo.Tree.Mapping
15 16
  * @subpackage Validator
16 17
  * @link http://www.gediminasm.org
17 18
  * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
18 19
  */
19
-class Validator 
20
+class Validator
20 21
 {
21 22
     /**
22 23
      * List of types which are valid for tree fields
@@ -56,6 +57,15 @@ class Validator
56 57
     );
57 58
 
58 59
     /**
60
+     * List of types which are valid for the path hash (materialized path strategy)
61
+     *
62
+     * @var array
63
+     */
64
+    private $validPathHashTypes = array(
65
+        'string'
66
+    );
67
+
68
+    /**
59 69
      * List of types which are valid for the path source (materialized path strategy)
60 70
      *
61 71
      * @var array
@@ -68,8 +78,6 @@ class Validator
68 78
         'string'
69 79
     );
70 80
 
71
-    
72
-
73 81
     /**
74 82
      * Checks if $field type is valid
75 83
      *
@@ -110,6 +118,19 @@ class Validator
110 118
     }
111 119
 
112 120
     /**
121
+     * Checks if $field type is valid for PathHash field
122
+     *
123
+     * @param object $meta
124
+     * @param string $field
125
+     * @return boolean
126
+     */
127
+    public function isValidFieldForPathHash($meta, $field)
128
+    {
129
+        $mapping = $meta->getFieldMapping($field);
130
+        return $mapping && in_array($mapping['type'], $this->validPathHashTypes);
131
+    }
132
+
133
+    /**
113 134
      * Checks if $field type is valid for LockTime field
114 135
      *
115 136
      * @param object $meta

+ 41 - 8
vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Strategy/AbstractMaterializedPath.php View File

@@ -17,6 +17,7 @@ use Gedmo\Exception\TreeLockingException;
17 17
  *
18 18
  * @author Gustavo Falco <comfortablynumb84@gmail.com>
19 19
  * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
20
+ * @author <rocco@roccosportal.com>
20 21
  * @package Gedmo.Tree.Strategy
21 22
  * @subpackage AbstractMaterializedPath
22 23
  * @link http://www.gediminasm.org
@@ -257,8 +258,10 @@ abstract class AbstractMaterializedPath implements Strategy
257 258
 
258 259
         $fieldMapping = $meta->getFieldMapping($config['path_source']);
259 260
 
260
-        // If PathSource field is a string, we append the ID to the path
261
-        if ($fieldMapping['type'] === 'string') {
261
+        // default behavior: if PathSource field is a string, we append the ID to the path
262
+        // path_append_id is true: always append id
263
+        // path_append_id is false: never append id
264
+        if ($config['path_append_id'] === true || ($fieldMapping['type'] === 'string' && $config['path_append_id']!==false)) {
262 265
             if (method_exists($meta, 'getIdentifierValue')) {
263 266
                 $identifier = $meta->getIdentifierValue($node);
264 267
             } else {
@@ -270,12 +273,11 @@ abstract class AbstractMaterializedPath implements Strategy
270 273
             $path .= '-'.$identifier;
271 274
         }
272 275
 
273
-        $path .= $config['path_separator'];
274 276
 
275 277
         if ($parent) {
276 278
             // Ensure parent has been initialized in the case where it's a proxy
277 279
             $om->initializeObject($parent);
278
-            
280
+
279 281
             $changeSet = $uow->isScheduledForUpdate($parent) ? $ea->getObjectChangeSet($uow, $parent) : false;
280 282
             $pathOrPathSourceHasChanged = $changeSet && (isset($changeSet[$config['path_source']]) || isset($changeSet[$config['path']]));
281 283
 
@@ -283,14 +285,41 @@ abstract class AbstractMaterializedPath implements Strategy
283 285
                 $this->updateNode($om, $parent, $ea);
284 286
             }
285 287
 
286
-            $path = $pathProp->getValue($parent).$path;
288
+            $parentPath = $pathProp->getValue($parent);
289
+            // if parent path not ends with separator
290
+            if ($parentPath[strlen($parentPath) - 1] !== $config['path_separator']) {
291
+                // add separator
292
+                $path = $pathProp->getValue($parent) . $config['path_separator'] . $path;
293
+            } else {
294
+                // don't add separator
295
+                $path = $pathProp->getValue($parent) . $path;
296
+            }
297
+
298
+        }
299
+
300
+
301
+        if ($config['path_starts_with_separator'] && (strlen($path) > 0 && $path[0] !== $config['path_separator'])) {
302
+            $path = $config['path_separator'] . $path;
303
+        }
304
+
305
+        if ($config['path_ends_with_separator'] && ($path[strlen($path) - 1] !== $config['path_separator'])) {
306
+            $path .= $config['path_separator'];
287 307
         }
288
-        
308
+
289 309
         $pathProp->setValue($node, $path);
290 310
         $changes = array(
291 311
             $config['path'] => array(null, $path)
292 312
         );
293 313
 
314
+        if (isset($config['path_hash'])) {
315
+            $pathHash = md5($path);
316
+            $pathHashProp = $meta->getReflectionProperty($config['path_hash']);
317
+            $pathHashProp->setAccessible(true);
318
+            $pathHashProp->setValue($node, $pathHash);
319
+            $changes[$config['path_hash']] = array(null, $pathHash);
320
+        }
321
+
322
+
294 323
         if (isset($config['level'])) {
295 324
             $level = substr_count($path, $config['path_separator']);
296 325
             $levelProp = $meta->getReflectionProperty($config['level']);
@@ -301,6 +330,10 @@ abstract class AbstractMaterializedPath implements Strategy
301 330
 
302 331
         $uow->scheduleExtraUpdate($node, $changes);
303 332
         $ea->setOriginalObjectProperty($uow, $oid, $config['path'], $path);
333
+
334
+        if(isset($config['path_hash'])){
335
+            $ea->setOriginalObjectProperty($uow, $oid, $config['path_hash'], $pathHash);
336
+        }
304 337
     }
305 338
 
306 339
     /**
@@ -354,7 +387,7 @@ abstract class AbstractMaterializedPath implements Strategy
354 387
 
355 388
                 $reflMethod->invoke($parentNode);
356 389
             }
357
-            
390
+
358 391
             // If tree is already locked, we throw an exception
359 392
             $lockTimeProp = $meta->getReflectionProperty($config['lock_time']);
360 393
             $lockTimeProp->setAccessible(true);
@@ -432,7 +465,7 @@ abstract class AbstractMaterializedPath implements Strategy
432 465
             }
433 466
         }
434 467
     }
435
-    
468
+
436 469
     /**
437 470
      * Locks all needed trees
438 471
      *

+ 1 - 1
vendor/gedmo/doctrine-extensions/lib/Gedmo/Uploadable/FilenameGenerator/FilenameGeneratorAlphanumeric.php View File

@@ -21,7 +21,7 @@ class FilenameGeneratorAlphanumeric implements FilenameGeneratorInterface
21 21
     /**
22 22
      * @inheritDoc
23 23
      */
24
-    public static function generate($filename, $extension)
24
+    public static function generate($filename, $extension, $object = null)
25 25
     {
26 26
         return preg_replace('/[^a-z0-9]+/', '-', strtolower($filename)).$extension;
27 27
     }

+ 2 - 1
vendor/gedmo/doctrine-extensions/lib/Gedmo/Uploadable/FilenameGenerator/FilenameGeneratorInterface.php View File

@@ -20,8 +20,9 @@ interface FilenameGeneratorInterface
20 20
      *
21 21
      * @param string - Filename without extension
22 22
      * @param string - Extension with dot: .jpg, .gif, etc
23
+     * @param $object
23 24
      *
24 25
      * @return string
25 26
      */
26
-    public static function generate($filename, $extension);
27
+    public static function generate($filename, $extension, $object = null);
27 28
 }

+ 1 - 1
vendor/gedmo/doctrine-extensions/lib/Gedmo/Uploadable/FilenameGenerator/FilenameGeneratorSha1.php View File

@@ -18,7 +18,7 @@ class FilenameGeneratorSha1 implements FilenameGeneratorInterface
18 18
     /**
19 19
      * @inheritDoc
20 20
      */
21
-    public static function generate($filename, $extension)
21
+    public static function generate($filename, $extension, $object = null)
22 22
     {
23 23
         return sha1(uniqid($filename.$extension, true)).$extension;
24 24
     }

+ 5 - 3
vendor/gedmo/doctrine-extensions/lib/Gedmo/Uploadable/UploadableListener.php View File

@@ -338,7 +338,7 @@ class UploadableListener extends MappedEventSubscriber
338 338
                 $generatorClass = $config['filenameGenerator'];
339 339
         }
340 340
 
341
-        $info = $this->moveFile($fileInfo, $path, $generatorClass, $config['allowOverwrite'], $config['appendNumber']);
341
+        $info = $this->moveFile($fileInfo, $path, $generatorClass, $config['allowOverwrite'], $config['appendNumber'], $object);
342 342
 
343 343
         // We override the mime type with the guessed one
344 344
         $info['fileMimeType'] = $mime;
@@ -428,6 +428,7 @@ class UploadableListener extends MappedEventSubscriber
428 428
      * @param bool $filenameGeneratorClass
429 429
      * @param bool $overwrite
430 430
      * @param bool $appendNumber
431
+     * @param $object
431 432
      * @return array
432 433
      * @throws \Gedmo\Exception\UploadableUploadException
433 434
      * @throws \Gedmo\Exception\UploadableNoFileException
@@ -439,7 +440,7 @@ class UploadableListener extends MappedEventSubscriber
439 440
      * @throws \Gedmo\Exception\UploadableNoTmpDirException
440 441
      * @throws \Gedmo\Exception\UploadableCantWriteException
441 442
      */
442
-    public function moveFile(FileInfoInterface $fileInfo, $path, $filenameGeneratorClass = false, $overwrite = false, $appendNumber = false)
443
+    public function moveFile(FileInfoInterface $fileInfo, $path, $filenameGeneratorClass = false, $overwrite = false, $appendNumber = false, $object)
443 444
     {
444 445
         if ($fileInfo->getError() > 0) {
445 446
             switch ($fileInfo->getError()) {
@@ -503,7 +504,8 @@ class UploadableListener extends MappedEventSubscriber
503 504
         if ($filenameGeneratorClass) {
504 505
             $filename = $filenameGeneratorClass::generate(
505 506
                 str_replace($path.'/', '', $info['fileWithoutExt']),
506
-                $info['fileExtension']
507
+                $info['fileExtension'],
508
+                $object
507 509
             );
508 510
             $info['filePath'] = str_replace(
509 511
                 '/'.$info['fileName'],

+ 0 - 148
vendor/gedmo/doctrine-extensions/schemas/orm/doctrine-extensions-mapping.xsd View File

@@ -1,148 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-
3
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
4
-    targetNamespace="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"
5
-    xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"
6
-    elementFormDefault="qualified">
7
-
8
-  <xs:annotation>
9
-    <xs:documentation><![CDATA[
10
-       This is the XML Schema for the object/relational
11
-       mapping file used by the Doctrine Extensions by Gedmo
12
-       extensions
13
-       Doctrine component version support: 2.2.x
14
-     ]]></xs:documentation>
15
-  </xs:annotation>
16
-
17
-<!--
18
-It would be nice if we could force the gedmo with only necessary elements into each of doctrine elements.
19
-Patches that do that are more than welcome.
20
-Please note, that marking e.g filed element in xml document with xsi:type is not an option as we need to allow other
21
-people to push their own additional attributes/elements into the same field element and they should not extend our schema
22
--->
23
-
24
-  <!-- entity -->
25
-  <xs:element name="translation" type="gedmo:translation"/>
26
-  <xs:element name="tree" type="gedmo:tree"/>
27
-  <xs:element name="tree-closure" type="gedmo:tree-closure"/>
28
-  <xs:element name="loggable" type="gedmo:loggable"/>
29
-  <xs:element name="soft-deleteable" type="gedmo:soft-deleteable"/>
30
-  <xs:element name="uploadable" type="gedmo:uploadable"/>
31
-  <!-- field -->
32
-  <xs:element name="slug" type="gedmo:slug"/>
33
-  <xs:element name="translatable" type="gedmo:translatable"/>
34
-  <xs:element name="timestampable" type="gedmo:timestampable"/>
35
-  <xs:element name="versioned" type="gedmo:emptyType"/>
36
-  <xs:element name="tree-left" type="gedmo:emptyType"/>
37
-  <xs:element name="tree-right" type="gedmo:emptyType"/>
38
-  <xs:element name="tree-level" type="gedmo:emptyType"/>
39
-  <xs:element name="tree-root" type="gedmo:emptyType"/>
40
-  <xs:element name="tree-parent" type="gedmo:emptyType"/>
41
-  <xs:element name="tree-path-source" type="gedmo:emptyType"/>
42
-  <xs:element name="tree-lock-time" type="gedmo:emptyType"/>
43
-  <xs:element name="sortable-group" type="gedmo:emptyType"/>
44
-  <xs:element name="sortable-position" type="gedmo:emptyType"/>
45
-  <xs:element name="uploadable-file-mime-type" type="gedmo:emptyType"/>
46
-  <xs:element name="uploadable-file-path" type="gedmo:emptyType"/>
47
-  <xs:element name="uploadable-file-size" type="gedmo:emptyType"/>
48
-
49
-  <xs:complexType name="translation">
50
-    <xs:attribute name="entity" type="xs:string" use="optional" />
51
-    <xs:attribute name="locale" type="xs:string" use="optional" />
52
-    <xs:attribute name="language" type="xs:string" use="optional" />
53
-  </xs:complexType>
54
-
55
-  <xs:complexType name="tree">
56
-    <xs:attribute name="type" type="gedmo:tree-type" default="nested" />
57
-    <xs:attribute name="activate-locking" type="xs:boolean" default="false" />
58
-    <xs:attribute name="locking-timeout" type="xs:integer" default="3" />
59
-  </xs:complexType>
60
-
61
-  <xs:complexType name="tree-closure">
62
-    <xs:attribute name="class" type="xs:string" use="required" />
63
-  </xs:complexType>
64
-
65
-  <xs:complexType name="tree-path">
66
-    <xs:attribute name="separator" type="xs:string" use="optional" default="|" />
67
-  </xs:complexType>
68
-
69
-  <xs:complexType name="loggable">
70
-    <xs:attribute name="log-entry-class" type="xs:string" use="optional" />
71
-  </xs:complexType>
72
-
73
-  <xs:complexType name="slug">
74
-    <xs:sequence>
75
-      <xs:element name="handler" type="gedmo:handler" minOccurs="0" maxOccurs="unbounded"/>
76
-    </xs:sequence>
77
-    <xs:attribute name="fields" type="xs:string" use="required"/>
78
-    <xs:attribute name="unique" type="xs:boolean" use="optional" />
79
-    <xs:attribute name="updatable" type="xs:boolean" use="optional" />
80
-    <xs:attribute name="separator" type="xs:string" use="optional" />
81
-    <xs:attribute name="style" type="gedmo:slug-style" use="optional" />
82
-  </xs:complexType>
83
-
84
-  <xs:complexType name="soft-deleteable">
85
-    <xs:attribute name="field-name" type="xs:string" use="required" />
86
-  </xs:complexType>
87
-  
88
-  <xs:complexType name="handler">
89
-    <xs:sequence>
90
-      <xs:element name="handler-option" type="gedmo:handler-option" minOccurs="0" maxOccurs="unbounded"/>
91
-    </xs:sequence>
92
-    <xs:attribute name="class" type="xs:string" use="required"/>
93
-  </xs:complexType>
94
-  
95
-  <xs:complexType name="handler-option">
96
-    <xs:attribute name="name" type="xs:string" use="required"/>
97
-    <xs:attribute name="value" type="xs:string" use="required"/>
98
-  </xs:complexType>
99
-
100
-  <xs:complexType name="timestampable">
101
-    <xs:attribute name="on" type="gedmo:timestampable-action" use="optional" />
102
-    <xs:attribute name="field" type="xs:string" use="optional" />
103
-    <xs:attribute name="value" type="xs:string" use="optional" />
104
-  </xs:complexType>
105
-
106
-  <xs:complexType name="translatable">
107
-    <xs:attribute name="fallback" type="xs:boolean" use="optional" />
108
-  </xs:complexType>
109
-
110
-  <xs:complexType name="emptyType">
111
-  </xs:complexType>
112
-
113
-  <xs:simpleType name="tree-type">
114
-    <xs:restriction base="xs:token">
115
-      <xs:enumeration value="nested"/>
116
-      <xs:enumeration value="closure"/>
117
-      <xs:enumeration value="materializedPath"/>
118
-    </xs:restriction>
119
-  </xs:simpleType>
120
-
121
-  <xs:simpleType name="slug-style">
122
-    <xs:restriction base="xs:token">
123
-      <xs:enumeration value="default"/>
124
-      <xs:enumeration value="camel"/>
125
-    </xs:restriction>
126
-  </xs:simpleType>
127
-
128
-  <xs:simpleType name="timestampable-action">
129
-    <xs:restriction base="xs:token">
130
-      <xs:enumeration value="create"/>
131
-      <xs:enumeration value="update"/>
132
-      <xs:enumeration value="change"/>
133
-    </xs:restriction>
134
-  </xs:simpleType>
135
-
136
-  <xs:complexType name="uploadable">
137
-    <xs:attribute name="allow-overwrite" type="xs:boolean" use="optional" />
138
-    <xs:attribute name="append-number" type="xs:boolean" use="optional" />
139
-    <xs:attribute name="callback" type="xs:string" use="optional" />
140
-    <xs:attribute name="path" type="xs:string" use="optional" />
141
-    <xs:attribute name="path-method" type="xs:string" use="optional" />
142
-    <xs:attribute name="filename-generator" type="xs:string" use="optional" />
143
-    <xs:attribute name="max-size" type="xs:double" use="optional" default="0" />
144
-    <xs:attribute name="allowed-types" type="xs:string" use="optional" />
145
-    <xs:attribute name="disallowed-types" type="xs:string" use="optional" />
146
-  </xs:complexType>
147
-
148
-</xs:schema>

+ 1 - 0
vendor/gedmo/doctrine-extensions/schemas/orm/doctrine-extensions-mapping.xsd View File

@@ -0,0 +1 @@
1
+doctrine-extensions-mapping-2-2.xsd

+ 58 - 0
vendor/gedmo/doctrine-extensions/tests/Gedmo/References/Fixture/ODM/MongoDB/Product.php View File

@@ -0,0 +1,58 @@
1
+<?php
2
+
3
+namespace References\Fixture\ODM\MongoDB;
4
+
5
+use Doctrine\Common\Collections\Collection;
6
+use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
7
+use Gedmo\Mapping\Annotation as Gedmo;
8
+
9
+/**
10
+ * @ODM\Document
11
+ */
12
+class Product
13
+{
14
+    /**
15
+     * @ODM\Id
16
+     */
17
+    private $id;
18
+
19
+    /**
20
+     * @ODM\String
21
+     */
22
+    private $name;
23
+
24
+    /**
25
+     * @Gedmo\ReferenceMany(type="entity", class="References\Fixture\ORM\StockItem", mappedBy="product")
26
+     */
27
+    private $stockItems;
28
+
29
+    public function getId()
30
+    {
31
+        return $this->id;
32
+    }
33
+
34
+    public function setId($id)
35
+    {
36
+        $this->id = $id;
37
+    }
38
+
39
+    public function getName()
40
+    {
41
+        return $this->name;
42
+    }
43
+
44
+    public function setName($name)
45
+    {
46
+        $this->name = $name;
47
+    }
48
+
49
+    public function getStockItems()
50
+    {
51
+        return $this->stockItems;
52
+    }
53
+
54
+    public function setStockItems(Collection $stockItems)
55
+    {
56
+        $this->stockItems = $stockItems;
57
+    }
58
+}

+ 105 - 0
vendor/gedmo/doctrine-extensions/tests/Gedmo/References/Fixture/ORM/StockItem.php View File

@@ -0,0 +1,105 @@
1
+<?php
2
+
3
+namespace References\Fixture\ORM;
4
+
5
+use Doctrine\ORM\Mapping as ORM;
6
+use Gedmo\Mapping\Annotation as Gedmo;
7
+use References\Fixture\ODM\MongoDB\Product;
8
+
9
+/**
10
+ * @ORM\Entity
11
+ */
12
+class StockItem
13
+{
14
+    /**
15
+     * @ORM\Id
16
+     * @ORM\Column(type="integer")
17
+     * @ORM\GeneratedValue(strategy="IDENTITY")
18
+     */
19
+    private $id;
20
+
21
+    /**
22
+     * @ORM\Column
23
+     */
24
+    private $name;
25
+
26
+    /**
27
+     * @ORM\Column
28
+     */
29
+    private $sku;
30
+
31
+    /**
32
+     * @ORM\Column(type="integer")
33
+     */
34
+    private $quantity;
35
+
36
+    /**
37
+     * @Gedmo\ReferenceOne(type="document", class="References\Fixture\ODM\MongoDB\Product", inversedBy="stockItems", identifier="productId")
38
+     */
39
+    private $product;
40
+
41
+    /**
42
+     * @ORM\Column(type="string")
43
+     */
44
+    private $productId;
45
+
46
+    public function getId()
47
+    {
48
+        return $this->id;
49
+    }
50
+
51
+    public function setId($id)
52
+    {
53
+        $this->id = $id;
54
+    }
55
+
56
+    public function getName()
57
+    {
58
+        return $this->name;
59
+    }
60
+
61
+    public function setName($name)
62
+    {
63
+        $this->name = $name;
64
+    }
65
+
66
+    public function getSku()
67
+    {
68
+        return $this->sku;
69
+    }
70
+
71
+    public function setSku($sku)
72
+    {
73
+        $this->sku = $sku;
74
+    }
75
+
76
+    public function getQuantity()
77
+    {
78
+        return $this->quantity;
79
+    }
80
+
81
+    public function setQuantity($quantity)
82
+    {
83
+        $this->quantity = $quantity;
84
+    }
85
+
86
+    public function setProduct(Product $product)
87
+    {
88
+        $this->product = $product;
89
+    }
90
+
91
+    public function getProduct()
92
+    {
93
+        return $this->product;
94
+    }
95
+
96
+    public function setProductId($productId)
97
+    {
98
+        $this->productId = $productId;
99
+    }
100
+
101
+    public function getProductId()
102
+    {
103
+        return $this->productId;
104
+    }
105
+}

+ 123 - 0
vendor/gedmo/doctrine-extensions/tests/Gedmo/References/ReferencesListenerTest.php View File

@@ -0,0 +1,123 @@
1
+<?php
2
+
3
+namespace Gedmo\References;
4
+
5
+use Doctrine\Common\Annotations\AnnotationReader;
6
+use Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver as MongoDBAnnotationDriver;
7
+use Doctrine\ODM\MongoDB\Configuration;
8
+use Doctrine\ORM\Mapping\Driver\AnnotationDriver as ORMAnnotationDriver;
9
+use References\Fixture\ODM\MongoDB\Product;
10
+use References\Fixture\ORM\StockItem;
11
+use Tool\BaseTestCaseOM;
12
+
13
+class ReferencesListenerTest extends BaseTestCaseOM
14
+{
15
+    private $em;
16
+    private $dm;
17
+
18
+    protected function setUp()
19
+    {
20
+        parent::setUp();
21
+
22
+        $reader = new AnnotationReader();
23
+
24
+        $this->dm = $this->getMockDocumentManager('test', new MongoDBAnnotationDriver($reader, __DIR__ . '/Fixture/ODM/MongoDB'));
25
+
26
+        $listener = new ReferencesListener(array(
27
+            'document' => $this->dm
28
+        ));
29
+
30
+        $this->evm->addEventSubscriber($listener);
31
+
32
+        $reader = new AnnotationReader();
33
+
34
+        $this->em = $this->getMockSqliteEntityManager(array('References\Fixture\ORM\StockItem'), new ORMAnnotationDriver($reader, __DIR__ . '/Fixture/ORM'));
35
+
36
+        $listener->registerManager('entity', $this->em);
37
+    }
38
+
39
+    public function testShouldPersistReferencedIdentifiersIntoIdentifierField()
40
+    {
41
+        $stockItem = new StockItem();
42
+        $stockItem->setName('Apple TV');
43
+        $stockItem->setSku('APP-TV');
44
+        $stockItem->setQuantity(25);
45
+
46
+        $product = new Product();
47
+        $product->setName('Apple TV');
48
+
49
+        $this->dm->persist($product);
50
+        $this->dm->flush();
51
+
52
+        $stockItem->setProduct($product);
53
+
54
+        $this->em->persist($stockItem);
55
+
56
+        $this->assertEquals($product->getId(), $stockItem->getProductId());
57
+    }
58
+
59
+    public function testShouldPopulateReferenceOneWithProxyFromIdentifierField()
60
+    {
61
+        $product = new Product();
62
+        $product->setName('Apple TV');
63
+
64
+        $this->dm->persist($product);
65
+        $this->dm->flush();
66
+
67
+        $stockItem = new StockItem();
68
+        $stockItem->setName('Apple TV');
69
+        $stockItem->setSku('APP-TV');
70
+        $stockItem->setQuantity(25);
71
+        $stockItem->setProductId($product->getId());
72
+
73
+        $this->em->persist($stockItem);
74
+        $this->em->flush();
75
+        $this->em->clear();
76
+
77
+        $stockItem = $this->em->find(get_class($stockItem), $stockItem->getId());
78
+
79
+        $this->assertSame($product, $stockItem->getProduct());
80
+    }
81
+
82
+    public function testShouldPopulateReferenceManyWithLazyCollectionInstance()
83
+    {
84
+        $product = new Product();
85
+        $product->setName('Apple TV');
86
+
87
+        $this->dm->persist($product);
88
+        $this->dm->flush();
89
+        $this->dm->clear();
90
+
91
+        $stockItem = new StockItem();
92
+        $stockItem->setName('Apple TV');
93
+        $stockItem->setSku('APP-TV');
94
+        $stockItem->setQuantity(25);
95
+        $stockItem->setProductId($product->getId());
96
+
97
+        $this->em->persist($stockItem);
98
+
99
+        $stockItem = new StockItem();
100
+        $stockItem->setName('Apple TV');
101
+        $stockItem->setSku('AMZN-APP-TV');
102
+        $stockItem->setQuantity(25);
103
+        $stockItem->setProductId($product->getId());
104
+
105
+        $this->em->persist($stockItem);
106
+        $this->em->flush();
107
+
108
+        $product = $this->dm->find(get_class($product), $product->getId());
109
+
110
+        $this->assertInstanceOf('Doctrine\Common\Collections\Collection', $product->getStockItems());
111
+        $this->assertEquals(2, $product->getStockItems()->count());
112
+
113
+        $first = $product->getStockItems()->first();
114
+
115
+        $this->assertInstanceOf(get_class($stockItem), $first);
116
+        $this->assertEquals('APP-TV', $first->getSku());
117
+
118
+        $last = $product->getStockItems()->last();
119
+
120
+        $this->assertInstanceOf(get_class($stockItem), $last);
121
+        $this->assertEquals('AMZN-APP-TV', $last->getSku());
122
+    }
123
+}

+ 6 - 0
vendor/gedmo/doctrine-extensions/tests/Gedmo/Tool/BaseTestCaseOM.php View File

@@ -303,6 +303,12 @@ abstract class BaseTestCaseOM extends \PHPUnit_Framework_TestCase
303 303
 
304 304
         $config
305 305
             ->expects($this->any())
306
+            ->method('getDefaultRepositoryClassName')
307
+            ->will($this->returnValue('Doctrine\\ORM\\EntityRepository'))
308
+        ;
309
+
310
+        $config
311
+            ->expects($this->any())
306 312
             ->method('getQuoteStrategy')
307 313
             ->will($this->returnValue(new DefaultQuoteStrategy()))
308 314
         ;

+ 108 - 0
vendor/gedmo/doctrine-extensions/tests/Gedmo/Tree/Fixture/MPFeaturesCategory.php View File

@@ -0,0 +1,108 @@
1
+<?php
2
+
3
+namespace Tree\Fixture;
4
+
5
+use Gedmo\Tree\Node as NodeInterface;
6
+use Gedmo\Mapping\Annotation as Gedmo;
7
+use Doctrine\ORM\Mapping as ORM;
8
+
9
+/**
10
+ * @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\MaterializedPathRepository")
11
+ * @Gedmo\Tree(type="materializedPath")
12
+ */
13
+class MPFeaturesCategory
14
+{
15
+    /**
16
+     * @ORM\Column(name="id", type="integer")
17
+     * @ORM\Id
18
+     * @ORM\GeneratedValue
19
+     */
20
+    private $id;
21
+
22
+    /**
23
+     * @Gedmo\TreePath(appendId=false, startsWithSeparator=true, endsWithSeparator=false)
24
+     * @ORM\Column(name="path", type="string", length=3000, nullable=true)
25
+     */
26
+    private $path;
27
+
28
+    /**
29
+     * @Gedmo\TreePathHash
30
+     * @ORM\Column(name="pathhash", type="string", length=32, nullable=true)
31
+     */
32
+    private $pathHash;
33
+
34
+    /**
35
+     * @Gedmo\TreePathSource
36
+     * @ORM\Column(name="title", type="string", length=64)
37
+     */
38
+    private $title;
39
+
40
+    /**
41
+     * @Gedmo\TreeParent
42
+     * @ORM\ManyToOne(targetEntity="MPFeaturesCategory", inversedBy="children")
43
+     * @ORM\JoinColumns({
44
+     *   @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="SET NULL")
45
+     * })
46
+     */
47
+    private $parentId;
48
+
49
+    /**
50
+     * @Gedmo\TreeLevel
51
+     * @ORM\Column(name="lvl", type="integer", nullable=true)
52
+     */
53
+    private $level;
54
+
55
+    /**
56
+     * @ORM\OneToMany(targetEntity="MPFeaturesCategory", mappedBy="parent")
57
+     */
58
+    private $children;
59
+
60
+    /**
61
+     * @ORM\OneToMany(targetEntity="Article", mappedBy="category")
62
+     */
63
+    private $comments;
64
+
65
+    public function getId()
66
+    {
67
+        return $this->id;
68
+    }
69
+
70
+    public function setTitle($title)
71
+    {
72
+        $this->title = $title;
73
+    }
74
+
75
+    public function getTitle()
76
+    {
77
+        return $this->title;
78
+    }
79
+
80
+    public function setParent(MPFeaturesCategory $parent = null)
81
+    {
82
+        $this->parentId = $parent;
83
+    }
84
+
85
+    public function getParent()
86
+    {
87
+        return $this->parentId;
88
+    }
89
+
90
+    public function setPath($path)
91
+    {
92
+        $this->path = $path;
93
+    }
94
+
95
+    public function getPath()
96
+    {
97
+        return $this->path;
98
+    }
99
+
100
+    public function getLevel()
101
+    {
102
+        return $this->level;
103
+    }
104
+
105
+    public function getPathHash(){
106
+        return $this->pathHash;
107
+    }
108
+}

+ 109 - 0
vendor/gedmo/doctrine-extensions/tests/Gedmo/Tree/MaterializedPathORMFeaturesTest.php View File

@@ -0,0 +1,109 @@
1
+<?php
2
+
3
+namespace Gedmo\Tree;
4
+
5
+use Doctrine\Common\EventManager;
6
+use Tool\BaseTestCaseORM;
7
+
8
+/**
9
+ * These are tests for Tree behavior
10
+ *
11
+ * @author Gustavo Falco <comfortablynumb84@gmail.com>
12
+ * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
13
+ * @package Gedmo.Tree
14
+ * @link http://www.gediminasm.org
15
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
16
+ */
17
+class MaterializedPathORMFeaturesTest extends BaseTestCaseORM
18
+{
19
+    const CATEGORY = "Tree\\Fixture\\MPFeaturesCategory";
20
+
21
+    protected $config;
22
+    protected $listener;
23
+
24
+    protected function setUp()
25
+    {
26
+        parent::setUp();
27
+
28
+        $this->listener = new TreeListener;
29
+
30
+        $evm = new EventManager;
31
+        $evm->addEventSubscriber($this->listener);
32
+
33
+        $this->getMockSqliteEntityManager($evm);
34
+
35
+        $meta = $this->em->getClassMetadata(self::CATEGORY);
36
+        $this->config = $this->listener->getConfiguration($this->em, $meta->name);
37
+    }
38
+
39
+    /**
40
+     * @test
41
+     */
42
+    function checkPathsAndHash()
43
+    {
44
+        $category = $this->createCategory();
45
+        $category->setTitle('1');
46
+        $category2 = $this->createCategory();
47
+        $category2->setTitle('2');
48
+        $category3 = $this->createCategory();
49
+        $category3->setTitle('3');
50
+        $category4 = $this->createCategory();
51
+        $category4->setTitle('4');
52
+
53
+        $category2->setParent($category);
54
+        $category3->setParent($category2);
55
+
56
+        $this->em->persist($category4);
57
+        $this->em->persist($category3);
58
+        $this->em->persist($category2);
59
+        $this->em->persist($category);
60
+        $this->em->flush();
61
+
62
+        $this->em->refresh($category);
63
+        $this->em->refresh($category2);
64
+        $this->em->refresh($category3);
65
+        $this->em->refresh($category4);
66
+
67
+        $this->assertEquals($this->generatePath(array('1' => $category->getId())), $category->getPath());
68
+        $this->assertEquals($this->generatePath(array('1' => $category->getId(), '2' => $category2->getId())), $category2->getPath());
69
+        $this->assertEquals($this->generatePath(array('1' => $category->getId(), '2' => $category2->getId(), '3' => $category3->getId())), $category3->getPath());
70
+        $this->assertEquals($this->generatePath(array('4' => $category4->getId())), $category4->getPath());
71
+
72
+        $this->assertEquals($this->generatePathHash(array('1' => $category->getId())), $category->getPathHash());
73
+        $this->assertEquals($this->generatePathHash(array('1' => $category->getId(), '2' => $category2->getId())), $category2->getPathHash());
74
+        $this->assertEquals($this->generatePathHash(array('1' => $category->getId(), '2' => $category2->getId(), '3' => $category3->getId())), $category3->getPathHash());
75
+        $this->assertEquals($this->generatePathHash(array('4' => $category4->getId())), $category4->getPathHash());
76
+    }
77
+
78
+
79
+
80
+
81
+    public function createCategory()
82
+    {
83
+        $class = self::CATEGORY;
84
+        return new $class;
85
+    }
86
+
87
+    protected function getUsedEntityFixtures()
88
+    {
89
+        return array(
90
+            self::CATEGORY
91
+        );
92
+    }
93
+
94
+    public function generatePath(array $sources)
95
+    {
96
+        $path = '';
97
+        foreach ($sources as $p => $id) {
98
+            $path .= $this->config['path_separator'] . $p;
99
+        }
100
+
101
+        return $path;
102
+    }
103
+
104
+    public function generatePathHash(array $sources)
105
+    {
106
+
107
+        return md5($this->generatePath($sources));
108
+    }
109
+}

+ 1 - 1
vendor/gedmo/doctrine-extensions/tests/Gedmo/Uploadable/FilenameGenerator/FilenameGeneratorAlphanumericTest.php View File

@@ -24,4 +24,4 @@ class FilenameGeneratorAlphanumericTest extends \PHPUnit_Framework_TestCase
24 24
 
25 25
         $this->assertEquals('meganame-for-a-file-.exe', $generator->generate($filename, $extension));
26 26
     }
27
-}
27
+}

+ 2 - 2
vendor/gedmo/doctrine-extensions/tests/Gedmo/Uploadable/UploadableEntityTest.php View File

@@ -691,8 +691,8 @@ class FakeFileInfo
691 691
 
692 692
 class FakeFilenameGenerator implements \Gedmo\Uploadable\FilenameGenerator\FilenameGeneratorInterface
693 693
 {
694
-    public static function generate($filename, $extension)
694
+    public static function generate($filename, $extension, $object = null)
695 695
     {
696 696
         return '123.txt';
697 697
     }
698
-}
698
+}

+ 1 - 0
vendor/gedmo/doctrine-extensions/tests/bootstrap.php View File

@@ -50,6 +50,7 @@ $loader->add('SoftDeleteable\\Fixture', __DIR__ . '/Gedmo');
50 50
 $loader->add('Uploadable\\Fixture', __DIR__ . '/Gedmo');
51 51
 $loader->add('Wrapper\\Fixture', __DIR__ . '/Gedmo');
52 52
 $loader->add('ReferenceIntegrity\\Fixture', __DIR__ . '/Gedmo');
53
+$loader->add('References\\Fixture', __DIR__ . '/Gedmo');
53 54
 // stubs
54 55
 $loader->add('Gedmo\\Uploadable\\Stub', __DIR__);
55 56
 

+ 3 - 0
vendor/gedmo/doctrine-extensions/tests/phpunit.xml.dist View File

@@ -53,6 +53,9 @@
53 53
         <testsuite name="ReferenceIntegrity Extension">
54 54
             <directory suffix="Test.php">./Gedmo/ReferenceIntegrity/</directory>
55 55
         </testsuite>
56
+        <testsuite name="References Extension">
57
+            <directory suffix="Test.php">./Gedmo/References/</directory>
58
+        </testsuite>
56 59
     </testsuites>
57 60
 
58 61
     <filter>

+ 1 - 1
vendor/gregwar/image-bundle/Gregwar/ImageBundle

@@ -1 +1 @@
1
-Subproject commit 3708563d5328aefe643e7c8a5dfe1591163dd2f0
1
+Subproject commit 55c372324c28c95f311d106ef75c01fb3b58cba3

+ 14 - 85
vendor/jdorn/sql-formatter/README.md View File

@@ -1,9 +1,8 @@
1 1
 SqlFormatter
2 2
 =============
3 3
 
4
-A lightweight php class for formatting sql statements.
5
-
6
-It can automatically indent and add line breaks in addition to syntax highlighting.
4
+A lightweight php class for formatting sql statements.  Handles automatic
5
+indentation and syntax highlighting.
7 6
 
8 7
 History
9 8
 ============
@@ -30,77 +29,25 @@ Sample usage:
30 29
 <?php
31 30
 require_once('SqlFormatter.php');
32 31
 
33
-$query = "SELECT count(*),`Column1`,`Testing`, `Testing Three` FROM `Table1`
34
-    WHERE Column1 = 'testing' AND ( (`Column2` = `Column3` OR Column4 >= NOW()) )
35
-    GROUP BY Column1 ORDER BY Column3 DESC LIMIT 5,10";
36
-
37
-echo SqlFormatter::format($query);
38
-```
39
-
40
-Output:
41
-
42
-![](http://jdorn.github.com/sql-formatter/format-highlight.png)
43
-
44
-Formatting Only
45
--------------------------
46
-If you don't want syntax highlighting and only want the indentations and 
47
-line breaks, pass in false as the second parameter.
48
-
49
-This is useful for outputting to error logs or other non-html formats.
50
-
51
-```php
52
-<?php
53
-echo SqlFormatter::format($query, false);
32
+echo SqlFormatter::format("SELECT * FROM MyTable LIMIT 10");
54 33
 ```
55 34
 
56
-Output:
35
+Sample output:
57 36
 
58
-![](http://jdorn.github.com/sql-formatter/format.png)
37
+![](http://github.com/jdorn/sql-formatter/raw/master/examples/SqlFormatterExample.png)
59 38
 
60 39
 Syntax Highlighting Only
61 40
 -------------------------
62 41
 
63
-There is a separate method 'highlight' that preserves all original whitespace
64
-and just adds syntax highlighting.
42
+There is also a static method 'highlight' that only does syntax highlighting 
43
+and preserves all original whitespace.
65 44
 
66 45
 This is useful for sql that is already well formatted and just needs to be a little
67 46
 easier to read.
68 47
 
69 48
 ```php
70 49
 <?php
71
-echo SqlFormatter::highlight($query);
72
-```
73
-
74
-Output:
75
-
76
-![](http://jdorn.github.com/sql-formatter/highlight.png)
77
-
78
-Remove Comments
79
-------------------------
80
-
81
-There is a removeComments method that, you guessed it, removes all comments from a query.
82
-
83
-```
84
-    SELECT
85
-    /* This is another comment
86
-    On more than one line */
87
-    Id #This is one final comment
88
-    as temp, DateCreated as Created FROM MyTable;
89
-```
90
-
91
-```php
92
-<?php
93
-echo SqlFormatter::removeComments($query);
94
-```
95
-
96
-Output:
97
-```
98
-
99
-    SELECT
100
-    
101
-    Id 
102
-    as temp, DateCreated as Created FROM MyTable;
50
+echo SqlFormatter::highlight("SELECT * FROM MyTable LIMIT 10");
103 51
 ```
104 52
 
105 53
 Split SQL String into Queries
@@ -120,24 +67,14 @@ SELECT * FROM MyTable;
120 67
 ```
121 68
 
122 69
 ```php
123
-<?php
124 70
 $queries = SqlFormatter::splitQuery($sql);
125 71
 ```
72
+$queries is now an array of the 4 queries without trailing semicolons.
126 73
 
127
-Result:
74
+Why not just use explode(';',$sql) or regular expressions?  The following example sql and others like it
75
+are impossible to split correctly using regular expressions.
128 76
 
129
-1.    `DROP TABLE IF EXISTS MyTable`;
130
-2.    `CREATE TABLE MyTable ( id int )`;
131
-3.    `INSERT INTO MyTable (id) VALUES (1),(2),(3),(4)`;
132
-4.    `SELECT * FROM MyTable`;
133
-
134
-### Why Not Regular Expressions?
135
-
136
-Why not just use `explode(';', $sql)` or a regular expression?
137
-
138
-The following example sql and others like it are _impossible_ to split correctly using regular expressions, no matter how complex.  
139
-
140
-```
77
+```sql
141 78
 SELECT ";"; SELECT ";\"; a;";
142 79
 SELECT ";
143 80
     abc";
@@ -145,15 +82,6 @@ SELECT a,b #comment;
145 82
 FROM test;
146 83
 ```
147 84
 
148
-SqlFormatter breaks the string into tokens instead of using regular expressions and will correctly produce:
149
-
150
-1.    `SELECT ";"`;
151
-2.    `SELECT ";\"; a;"`;
152
-3.    `SELECT "; abc"`;
153
-4.    `SELECT a,b #comment;
154
-FROM test`;
155
-
156
-Please note, the splitQuery method will still fail in the following cases:
85
+The splitQuery method will still fail in the following cases:
157 86
 *    The DELIMITER command can be used to change the delimiter from the default ';' to something else.  
158
-*    The CREATE PROCEDURE command has a ';' in the middle of it
159
-*    The USE command is not terminated with a ';'
87
+*    The CREATE PROCEDURE command

BIN
vendor/jdorn/sql-formatter/examples/SqlFormatterExample.png View File


+ 0 - 14
vendor/jdorn/sql-formatter/examples/examples.php View File

@@ -74,20 +74,6 @@ $split_statements = array(
74 74
         abc\";
75 75
     SELECT a,b #comment;
76 76
     FROM test;",
77
-    
78
-    "
79
-    -- Drop the table first if it exists
80
-    DROP TABLE IF EXISTS MyTable;
81
-
82
-    -- Create the table
83
-    CREATE TABLE MyTable ( id int );
84
-
85
-    -- Insert values
86
-    INSERT INTO MyTable (id)
87
-        VALUES
88
-        (1),(2),(3),(4);
89
-
90
-    -- Done",
91 77
 );
92 78
 
93 79
 // Example statements for removing comments

File diff suppressed because it is too large
+ 321 - 403
vendor/jdorn/sql-formatter/lib/SqlFormatter.php


File diff suppressed because it is too large
+ 0 - 4365
vendor/jdorn/sql-formatter/tests/expected.html


+ 0 - 0
vendor/jdorn/sql-formatter/tests/performance.php View File


Some files were not shown because too many files changed in this diff