Browse Source

Evolution #57: Modifier le système de Type (element)

bastien 13 years ago
parent
commit
c1b4c50f6d

+ 2 - 1
src/Muzich/CoreBundle/Controller/CoreController.php View File

@@ -155,9 +155,10 @@ class CoreController extends Controller
155 155
     }
156 156
     
157 157
     $element = new Element();
158
+    $element->setType('none');
158 159
     $form = $this->getAddForm($element);
159
-    
160 160
     $form->bindRequest($this->getRequest());
161
+    
161 162
     if ($form->isValid())
162 163
     {
163 164
 

+ 21 - 27
src/Muzich/CoreBundle/DataFixtures/ORM/LoadElementData.php View File

@@ -80,69 +80,63 @@ class LoadElementData  extends AbstractFixture implements OrderedFixtureInterfac
80 80
     $paul = $this->entity_manager->merge($this->getReference('user_paul'));
81 81
     $bob  = $this->entity_manager->merge($this->getReference('user_bob'));
82 82
     $joelle  = $this->entity_manager->merge($this->getReference('user_joelle'));
83
-
84
-    // 'youtube', 'soundclound', 'son2teuf', 'jamendo'
85
-    $youtube     = $this->entity_manager->merge($this->getReference('element_type_youtube.com'));
86
-    $soundclound = $this->entity_manager->merge($this->getReference('element_type_soundcloud.com'));
87
-    $son2teuf    = $this->entity_manager->merge($this->getReference('element_type_son2teuf.org'));
88
-    $jamendo     = $this->entity_manager->merge($this->getReference('element_type_jamendo.com'));
89 83
     
90 84
     $this->createElement('youtube_heretik_1', 'Heretik System Popof - Resistance', 
91 85
       'http://www.youtube.com/watch?v=tq4DjQK7nsM',
92 86
       $this->getArrayOfTag(array('hardtek')),
93
-    $youtube, $bux, null, '2011-12-10 17:35:07');
87
+    'youtube.com', $bux, null, '2011-12-10 17:35:07');
94 88
     
95 89
     $this->createElement('youtube_dtc_passdrop', 'dtc che passdrop', 
96 90
       'http://www.youtube.com/watch?v=2A4buFCp7qM', 
97 91
       $this->getArrayOfTag(array('hardtek')),
98
-    $youtube, $bux, null, '2011-12-10 18:35:07');
92
+    'youtube.com', $bux, null, '2011-12-10 18:35:07');
99 93
     
100 94
     $this->createElement('youtube_antroppod_1', 'Antropod - Polakatek', 
101 95
       'http://www.youtube.com/watch?v=VvpF3lCh1hk&NR=1', 
102 96
       $this->getArrayOfTag(array('hardtek')),
103
-    $youtube, $bux, null, '2011-12-10 19:45:07');
97
+    'youtube.com', $bux, null, '2011-12-10 19:45:07');
104 98
     
105 99
     $this->createElement('youtube_koinkoin_1', 'koinkOin - H5N1', 
106 100
       'http://www.son2teuf.org/Voir-details/Sons/Lives/Hardtek-_-Tribe/koinkOin-_-H5N1', 
107 101
       $this->getArrayOfTag(array('hardtek', 'electro')),
108
-    $youtube, $bux, null, '2011-12-10 21:35:07');
102
+    'son2teuf.org', $bux, null, '2011-12-10 21:35:07');
109 103
     
110 104
     
111 105
     $this->createElement('youtube_djfab_1', 'DJ FAB', 
112 106
       'http://www.jamendo.com/fr/album/42567', 
113 107
       $this->getArrayOfTag(array('hardtek')),
114
-    $jamendo, $jean, null, '2011-11-11 17:35:07');
108
+    'jamendo.com', $jean, null, '2011-11-11 17:35:07');
115 109
     
116 110
     $this->createElement('youtube_djantoine_1', 'dj antoine', 
117 111
       'http://www.jamendo.com/fr/album/75206', 
118 112
       $this->getArrayOfTag(array('hardtek', 'tribe')),
119
-    $jamendo, $jean, null, '2011-11-11 19:35:07');
113
+    'jamendo.com', $jean, null, '2011-11-11 19:35:07');
120 114
     
121 115
     $this->createElement('youtube_acroyek_1', 'Acrotek Hardtek G01', 
122 116
       'http://www.jamendo.com/fr/album/3409', 
123 117
       $this->getArrayOfTag(array('hardtek')),
124
-    $jamendo, $jean, null, '2011-12-11 14:35:07');
118
+    'jamendo.com', $jean, null, '2011-12-11 14:35:07');
125 119
     
126 120
     
127 121
     $this->createElement('jamendo_caio_1', 'All Is Full Of Pain', 
128 122
       'http://soundcloud.com/keytek/all-is-full-of-pain', 
129 123
       $this->getArrayOfTag(array('tribe', 'hardtek')),
130
-    $soundclound, $paul, null, '2011-12-02 01:35:07');
124
+    'soundcloud.com', $paul, null, '2011-12-02 01:35:07');
131 125
     
132 126
     $this->createElement('jamendo_reverb_1', 'RE-FUCK (ReVeRB_FBC) mix.', 
133 127
       'http://soundcloud.com/reverb-2/re-fuck-reverb_fbc-mix', 
134 128
       $this->getArrayOfTag(array('tribe')),
135
-    $soundclound, $paul, null, '2011-12-04 14:35:07');
129
+    'soundcloud.com', $paul, null, '2011-12-04 14:35:07');
136 130
     
137 131
     $this->createElement('jamendo_cardio_1', 'CardioT3K - Juggernaut Trap', 
138 132
       'http://soundcloud.com/cardiot3k/cardiot3k-juggernaut-trap', 
139 133
       $this->getArrayOfTag(array('tribe')),
140
-    $soundclound, $paul, null, '2011-12-12 13:35:07');
134
+    'soundcloud.com', $paul, null, '2011-12-12 13:35:07');
141 135
     
142 136
     $this->createElement('dudeldrum', 'DUDELDRUM', 
143 137
       'http://www.jamendo.com/fr/album/89109', 
144 138
       $this->getArrayOfTag(array('medieval')),
145
-      $jamendo, $joelle,
139
+      'jamendo.com', $joelle,
146 140
       $this->entity_manager->merge($this->getReference('group_dudeldrum'))
147 141
       , '2011-12-16 18:11:07'
148 142
     );
@@ -150,7 +144,7 @@ class LoadElementData  extends AbstractFixture implements OrderedFixtureInterfac
150 144
     $this->createElement('infected_psycho', 'Infected Mushroom - Psycho', 
151 145
       'http://www.youtube.com/watch?v=dLWXSsYJoWY', 
152 146
       $this->getArrayOfTag(array('psytrance')),
153
-      $youtube, $paul,
147
+      'youtube.com', $paul,
154 148
       $this->entity_manager->merge($this->getReference('group_fan_de_psytrance'))
155 149
       , '2011-12-10 16:11:17'
156 150
     );
@@ -158,7 +152,7 @@ class LoadElementData  extends AbstractFixture implements OrderedFixtureInterfac
158 152
     $this->createElement('infected_muse', 'Infected mushroom - Muse Breaks', 
159 153
       'http://www.youtube.com/watch?v=g0Cbfm1PStA', 
160 154
       $this->getArrayOfTag(array('psytrance')),
161
-      $youtube, $bob,
155
+      'youtube.com', $bob,
162 156
       $this->entity_manager->merge($this->getReference('group_fan_de_psytrance'))
163 157
       , '2011-12-08 17:35:07'
164 158
     );
@@ -166,13 +160,13 @@ class LoadElementData  extends AbstractFixture implements OrderedFixtureInterfac
166 160
     $this->createElement('joelle_1', 'Cents Pas - Joëlle', 
167 161
       'http://www.youtube.com/watch?v=bIAFB4vRdGw', 
168 162
       $this->getArrayOfTag(array('chanteuse')),
169
-      $youtube, $joelle, null, '2011-12-08 14:21:07'
163
+      'youtube.com', $joelle, null, '2011-12-08 14:21:07'
170 164
     );
171 165
     
172 166
     $this->createElement('joelle_2', 'Cents Pas - Joëlle (bis)', 
173 167
       'http://www.youtube.com/watch?v=bIAFB4vRdGw', 
174 168
       $this->getArrayOfTag(array('chanteuse')),
175
-      $youtube, $joelle,
169
+      'youtube.com', $joelle,
176 170
       $this->entity_manager->merge($this->getReference('group_joelle'))
177 171
       , '2011-12-07 14:12:07'
178 172
     );
@@ -180,37 +174,37 @@ class LoadElementData  extends AbstractFixture implements OrderedFixtureInterfac
180 174
     $this->createElement('ukf_1', 'UKF Dubstep Mix - August ', 
181 175
       'http://www.youtube.com/watch?v=SFu2DfPDGeU', 
182 176
       $this->getArrayOfTag(array('dubstep')),
183
-      $youtube, $joelle, null, '2011-12-10 00:35:07'
177
+      'youtube.com', $joelle, null, '2011-12-10 00:35:07'
184 178
     );
185 179
     
186 180
     $this->createElement('beatbox_1', 'Dubstep Beatbox', 
187 181
       'http://www.dailymotion.com/video/xm5omz_dubstep-beatbox_creation', 
188 182
       $this->getArrayOfTag(array('dubstep', 'beatbox')),
189
-      null, $joelle, null, '2011-12-10 11:11:11'
183
+      'dailymotion.com', $joelle, null, '2011-12-10 11:11:11'
190 184
     );
191 185
     
192 186
     $this->createElement('soulfly_1', 'SOULFLY - Prophecy', 
193 187
       'http://www.youtube.com/watch?v=zCc_jLctZkA', 
194 188
       $this->getArrayOfTag(array('metal')),
195
-      $youtube, $bux, null, '2011-12-12 17:39:07'
189
+      'youtube.com', $bux, null, '2011-12-12 17:39:07'
196 190
     );
197 191
     
198 192
     $this->createElement('azyd_azylum_1', 'AZYD AZYLUM Live au Café Provisoire', 
199 193
       'http://www.youtube.com/watch?v=8AXhRXAt2E4', 
200 194
       $this->getArrayOfTag(array('metal')),
201
-      $youtube, $bux, null, '2011-11-11 11:11:11'
195
+      'youtube.com', $bux, null, '2011-11-11 11:11:11'
202 196
     );
203 197
     
204 198
     $this->createElement('babylon_pression_1', 'Babylon Pression - Des Tasers et des Pauvres', 
205 199
       'http://www.youtube.com/watch?v=XWkbaHxRvds&feature=related', 
206 200
       $this->getArrayOfTag(array('metal', 'hardcore')),
207
-      $youtube, $bux, null, '2011-12-14 18:35:07'
201
+      'youtube.com', $bux, null, '2011-12-14 18:35:07'
208 202
     );
209 203
     
210 204
     $this->createElement('ed_cox_1', 'Ed Cox - La fanfare des teuffeurs (Hardcordian)', 
211 205
       'http://www.youtube.com/watch?v=Lk1gnh-JCDs&feature=related', 
212 206
       $this->getArrayOfTag(array('electro')),
213
-      $youtube, $bux, null, '2011-12-15 21:35:07'
207
+      'youtube.com', $bux, null, '2011-12-15 21:35:07'
214 208
     );
215 209
     
216 210
 

+ 0 - 54
src/Muzich/CoreBundle/DataFixtures/ORM/LoadElementTypeData.php View File

@@ -1,54 +0,0 @@
1
-<?php
2
-
3
-namespace Muzich\UserBundle\DataFixtures\ORM;
4
-
5
-use Doctrine\Common\DataFixtures\AbstractFixture;
6
-use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
7
-use Symfony\Component\DependencyInjection\ContainerAwareInterface;
8
-use Symfony\Component\DependencyInjection\ContainerInterface;
9
-use Muzich\CoreBundle\Entity\ElementType;
10
-
11
-class LoadElementTypeData  extends AbstractFixture implements OrderedFixtureInterface, ContainerAwareInterface
12
-{
13
-  
14
-  private $container;
15
-  private $entity_manager;
16
-  
17
-  public function setContainer(ContainerInterface $container = null)
18
-  {
19
-    $this->container = $container;
20
-  }
21
-  
22
-  public function getOrder()
23
-  {
24
-    return 3; // the order in which fixtures will be loaded
25
-  }
26
-  
27
-  /**
28
-   *  
29
-   */
30
-  protected function createElementType($id, $name)
31
-  {
32
-    $elementType = new ElementType();
33
-    $elementType->setId($id);
34
-    $elementType->setName(ucfirst($name));
35
-    $this->entity_manager->persist($elementType);
36
-    $this->addReference('element_type_'.$id, $elementType);
37
-  }
38
-  
39
-  public function load($entity_manager)
40
-  {
41
-    $this->entity_manager = $entity_manager;
42
-    
43
-    foreach (array(
44
-      'youtube.com' => 'Youtube', 'soundcloud.com' => 'SoundCloud', 
45
-      'son2teuf.org' => 'Son2Teuf', 'jamendo.com' => 'jamendo',
46
-      'dailymotion.com' => 'Dailymotion'
47
-      ) as $id => $name)
48
-    {
49
-      $this->createElementType($id, $name);
50
-    }
51
-
52
-    $this->entity_manager->flush();
53
-  }
54
-}

+ 22 - 30
src/Muzich/CoreBundle/ElementFactory/ElementManager.php View File

@@ -7,11 +7,10 @@ use Muzich\CoreBundle\Entity\User;
7 7
 use Doctrine\ORM\EntityManager;
8 8
 use Symfony\Component\DependencyInjection\Container;
9 9
 
10
-use Muzich\CoreBundle\ElementFactory\Site\YoutubeFactory;
11
-use Muzich\CoreBundle\ElementFactory\Site\DailymotionFactory;
12
-use Muzich\CoreBundle\ElementFactory\Site\Son2TeufFactory;
13
-use Muzich\CoreBundle\ElementFactory\Site\JamendoFactory;
14
-use Muzich\CoreBundle\ElementFactory\Site\SoundCloudFactory;
10
+use Muzich\CoreBundle\ElementFactory\Site\YoutubecomFactory;
11
+use Muzich\CoreBundle\ElementFactory\Site\DailymotioncomFactory;
12
+use Muzich\CoreBundle\ElementFactory\Site\JamendocomFactory;
13
+use Muzich\CoreBundle\ElementFactory\Site\SoundcloudcomFactory;
15 14
 
16 15
 /**
17 16
  * 
@@ -19,19 +18,11 @@ use Muzich\CoreBundle\ElementFactory\Site\SoundCloudFactory;
19 18
  * @author bux
20 19
  */
21 20
 class ElementManager
22
-{
23
-  
24
-  protected $types = array(
25
-    'youtube.com', 
26
-    'soundcloud.com', 
27
-    'son2teuf.org', 
28
-    'jamendo.com',
29
-    'dailymotion.com'
30
-  );
31
-  
21
+{  
32 22
   protected $em;
33 23
   protected $element;
34 24
   protected $container;
25
+  protected $factories;
35 26
   
36 27
   /**
37 28
    * Procédure chargé de retourner des information destiné au 
@@ -60,7 +51,8 @@ class ElementManager
60 51
     $this->element = $element;
61 52
     $this->em = $em;
62 53
     $this->container = $container;
63
-    
54
+    $this->factories = $this->container->getParameter('factories');
55
+        
64 56
     $evm = new \Doctrine\Common\EventManager();
65 57
     $timestampableListener = new \Gedmo\Timestampable\TimestampableListener();
66 58
     $evm->addEventSubscriber($timestampableListener);
@@ -106,17 +98,16 @@ class ElementManager
106 98
     
107 99
     preg_match("/^(http:\/\/)?([^\/]+)/i", $url, $chaines);
108 100
     
101
+    $type = 'unknow';
109 102
     if (array_key_exists(2, $chaines))
110 103
     {
111 104
       $host = $chaines[2];
112 105
       // Repérer les derniers segments
113 106
       preg_match("/[^\.\/]+\.[^\.\/]+$/",$host,$chaines);
114 107
 
115
-      $type = null;
116
-
117
-      if (in_array($chaines[0], $this->types))
108
+      if (array_key_exists(0, $chaines))
118 109
       {
119
-        $type = $this->em->getRepository('MuzichCoreBundle:ElementType')->find($chaines[0]);
110
+        $type = $chaines[0];
120 111
       }
121 112
     }
122 113
     
@@ -134,7 +125,7 @@ class ElementManager
134 125
     // Instanciation d'un objet factory correspondant au type, par exemple
135 126
     // YoutubeFactory, qui répondant a une implementation retournera ces infos.
136 127
   
137
-    if ($this->element->getType())
128
+    if (in_array($this->element->getType(), $this->factories))
138 129
     {
139 130
       $site_factory = $this->getFactory();
140 131
       $this->element->setEmbed($site_factory->getEmbedCode());
@@ -144,27 +135,28 @@ class ElementManager
144 135
   
145 136
   protected function getFactory()
146 137
   { 
147
-    switch ($this->element->getType()->getId())
138
+//    $factory_name = ucfirst(str_replace('.', '', $this->element->getType())).'Factory';
139
+//    return new $factory_name($this->element, $this->container);
140
+    
141
+    switch ($this->element->getType())
148 142
     {
149 143
       case 'youtube.com':
150
-        return new YoutubeFactory($this->element, $this->container);
144
+        return new YoutubecomFactory($this->element, $this->container);
151 145
       break;
152 146
       case 'soundcloud.com':
153
-        return new SoundCloudFactory($this->element, $this->container);
154
-      break;
155
-      case 'son2teuf.org':
156
-        return new Son2TeufFactory($this->element, $this->container);
147
+        return new SoundcloudcomFactory($this->element, $this->container);
157 148
       break;
158 149
       case 'jamendo.com':
159
-        return new JamendoFactory($this->element, $this->container);
150
+        return new JamendocomFactory($this->element, $this->container);
160 151
       break;
161 152
       case 'dailymotion.com':
162
-        return new DailymotionFactory($this->element, $this->container);
153
+        return new DailymotioncomFactory($this->element, $this->container);
163 154
       break;
164 155
       default:
165
-        throw new Exception("La Factory n'est pas connu pour ce type.");
156
+        throw new Exception("La Factory n'est pas prise en charge pour ce type.");
166 157
       break;
167 158
     }
159
+    
168 160
   }
169 161
     
170 162
 }

src/Muzich/CoreBundle/ElementFactory/Site/DailymotionFactory.php → src/Muzich/CoreBundle/ElementFactory/Site/DailymotioncomFactory.php View File

@@ -9,7 +9,7 @@ use Muzich\CoreBundle\ElementFactory\Site\base\VideoSiteFactory;
9 9
  *
10 10
  * @author bux
11 11
  */
12
-class DailymotionFactory extends VideoSiteFactory
12
+class DailymotioncomFactory extends VideoSiteFactory
13 13
 {
14 14
   
15 15
 }

src/Muzich/CoreBundle/ElementFactory/Site/JamendoFactory.php → src/Muzich/CoreBundle/ElementFactory/Site/JamendocomFactory.php View File

@@ -9,7 +9,7 @@ use Muzich\CoreBundle\ElementFactory\Site\base\BaseFactory;
9 9
  *
10 10
  * @author bux
11 11
  */
12
-class JamendoFactory extends BaseFactory
12
+class JamendocomFactory extends BaseFactory
13 13
 {
14 14
   public function getEmbedCode()
15 15
   {

+ 0 - 17
src/Muzich/CoreBundle/ElementFactory/Site/Son2TeufFactory.php View File

@@ -1,17 +0,0 @@
1
-<?php
2
-
3
-namespace Muzich\CoreBundle\ElementFactory\Site;
4
-
5
-use Muzich\CoreBundle\ElementFactory\Site\base\BaseFactory;
6
-
7
-/**
8
- * 
9
- *
10
- * @author bux
11
- */
12
-class Son2TeufFactory extends BaseFactory
13
-{
14
-  
15
-}
16
-
17
-?>

src/Muzich/CoreBundle/ElementFactory/Site/SoundCloudFactory.php → src/Muzich/CoreBundle/ElementFactory/Site/SoundcloudcomFactory.php View File

@@ -11,7 +11,7 @@ use Symfony\Component\DependencyInjection\Container;
11 11
  *
12 12
  * @author bux
13 13
  */
14
-class SoundCloudFactory extends BaseFactory
14
+class SoundcloudcomFactory extends BaseFactory
15 15
 {
16 16
   public function getEmbedCode()
17 17
   {

src/Muzich/CoreBundle/ElementFactory/Site/YoutubeFactory.php → src/Muzich/CoreBundle/ElementFactory/Site/YoutubecomFactory.php View File

@@ -9,7 +9,7 @@ use Muzich\CoreBundle\ElementFactory\Site\base\VideoSiteFactory;
9 9
  *
10 10
  * @author bux
11 11
  */
12
-class YoutubeFactory extends VideoSiteFactory
12
+class YoutubecomFactory extends VideoSiteFactory
13 13
 {
14 14
   
15 15
 }

+ 6 - 5
src/Muzich/CoreBundle/Entity/Element.php View File

@@ -32,8 +32,9 @@ class Element
32 32
   /**
33 33
    * Cet attribut stocke le type d'élément.
34 34
    * 
35
-   * @ORM\ManyToOne(targetEntity="ElementType", inversedBy="elements")
36
-   * @ORM\JoinColumn(name="element_type_id", referencedColumnName="id")
35
+   * @ORM\Column(type="string", length=64)
36
+   * @Assert\NotBlank()
37
+   * @Assert\MaxLength(1024)
37 38
    */
38 39
   protected $type;
39 40
   
@@ -171,9 +172,9 @@ class Element
171 172
   /**
172 173
    * Set type
173 174
    *
174
-   * @param ElementType $type
175
+   * @param string $type
175 176
    */
176
-  public function setType(ElementType $type = null)
177
+  public function setType($type)
177 178
   {
178 179
     $this->type = $type;
179 180
   }
@@ -181,7 +182,7 @@ class Element
181 182
   /**
182 183
    * Get type
183 184
    *
184
-   * @return ElementType 
185
+   * @return string 
185 186
    */
186 187
   public function getType()
187 188
   {

+ 0 - 114
src/Muzich/CoreBundle/Entity/ElementType.php View File

@@ -1,114 +0,0 @@
1
-<?php
2
-
3
-namespace Muzich\CoreBundle\Entity;
4
-
5
-use Doctrine\ORM\Mapping as ORM;
6
-use \Doctrine\Common\Collections\ArrayCollection;
7
-
8
-/**
9
- * Type d'element
10
- *  * Youtube
11
- *  * Jamendo
12
- *  * ...
13
- * 
14
- * @ORM\Entity
15
- * @ORM\Table(name="element_type")
16
- */
17
-class ElementType
18
-{
19
-  
20
-  /**
21
-   * @ORM\Id
22
-   * @ORM\Column(type="string", length=18)
23
-   * @var type string
24
-   */
25
-  protected $id;
26
-  
27
-  /**
28
-   * Liste des elements de ce type
29
-   * 
30
-   * @ORM\OneToMany(targetEntity="Element", mappedBy="element_type")
31
-   */
32
-  protected $elements;
33
-  
34
-  /**
35
-   * Libelle du type
36
-   * 
37
-   * @ORM\Column(type="string", length=128)
38
-   * @var type string
39
-   */
40
-  protected $name;
41
-  
42
-  /**
43
-   * 
44
-   */
45
-  public function __construct()
46
-  {
47
-    $this->elements = new ArrayCollection();
48
-  }
49
-  
50
-  public function __toString()
51
-  {
52
-    return $this->name;
53
-  }
54
-
55
-  /**
56
-   * Set name
57
-   *
58
-   * @param string $name
59
-   */
60
-  public function setName($name)
61
-  {
62
-    $this->name = $name;
63
-  }
64
-
65
-  /**
66
-   * Get name
67
-   *
68
-   * @return string 
69
-   */
70
-  public function getName()
71
-  {
72
-    return $this->name;
73
-  }
74
-  
75
-  /**
76
-   * Set id
77
-   *
78
-   * @param string $id
79
-   */
80
-  public function setId($id)
81
-  {
82
-    $this->id = $id;
83
-  }
84
-
85
-  /**
86
-   * Get id
87
-   *
88
-   * @return string 
89
-   */
90
-  public function getId()
91
-  {
92
-    return $this->id;
93
-  }
94
-
95
-  /**
96
-   * Add elements
97
-   *
98
-   * @param Element $elements
99
-   */
100
-  public function addElement(Element $elements)
101
-  {
102
-    $this->elements[] = $elements;
103
-  }
104
-
105
-  /**
106
-   * Get elements
107
-   *
108
-   * @return Doctrine\Common\Collections\Collection 
109
-   */
110
-  public function getElements()
111
-  {
112
-    return $this->elements;
113
-  }
114
-}

+ 2 - 4
src/Muzich/CoreBundle/Repository/ElementRepository.php View File

@@ -18,8 +18,7 @@ class ElementRepository extends EntityRepository
18 18
   {
19 19
     return $this->getEntityManager()
20 20
       ->createQuery('
21
-        SELECT e, t FROM MuzichCoreBundle:Element e 
22
-        JOIN e.type t
21
+        SELECT e FROM MuzichCoreBundle:Element e 
23 22
         ORDER BY e.name ASC'
24 23
       )
25 24
       ->getResult()
@@ -165,10 +164,9 @@ class ElementRepository extends EntityRepository
165 164
       }
166 165
 
167 166
       // C'est la requête qui récupérera les données element avec ses jointures.
168
-      $query_select = "SELECT e, ty, t, o, g, fav
167
+      $query_select = "SELECT e, t, o, g, fav
169 168
         FROM MuzichCoreBundle:Element e 
170 169
         LEFT JOIN e.group g 
171
-        LEFT JOIN e.type ty 
172 170
         LEFT JOIN e.tags t 
173 171
         LEFT JOIN e.elements_favorites fav WITH fav.user = :uid
174 172
         JOIN e.owner o