Browse Source

Mse en forme et ajout de commentaire dans les Entités.

bastien 13 years ago
parent
commit
b7791ee38e

+ 51 - 0
app/logs/dev.log View File

29568
 [2011-09-08 18:09:17] doctrine.DEBUG: SELECT t0.id AS id1, t0.position AS position2, t0.user_id AS user_id3, t0.tag_id AS tag_id4 FROM users_tags_favorites t0 WHERE t0.user_id = ? ([1]) [] []
29568
 [2011-09-08 18:09:17] doctrine.DEBUG: SELECT t0.id AS id1, t0.position AS position2, t0.user_id AS user_id3, t0.tag_id AS tag_id4 FROM users_tags_favorites t0 WHERE t0.user_id = ? ([1]) [] []
29569
 [2011-09-08 18:09:17] doctrine.DEBUG: SELECT t0.id AS id1, t0.name AS name2 FROM tag t0 WHERE t0.id = ? ([1]) [] []
29569
 [2011-09-08 18:09:17] doctrine.DEBUG: SELECT t0.id AS id1, t0.name AS name2 FROM tag t0 WHERE t0.id = ? ([1]) [] []
29570
 [2011-09-08 18:09:17] doctrine.DEBUG: SELECT t0.id AS id1, t0.name AS name2 FROM tag t0 WHERE t0.id = ? ([2]) [] []
29570
 [2011-09-08 18:09:17] doctrine.DEBUG: SELECT t0.id AS id1, t0.name AS name2 FROM tag t0 WHERE t0.id = ? ([2]) [] []
29571
+[2011-09-08 18:11:58] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\RouterListener::onEarlyKernelRequest". [] []
29572
+[2011-09-08 18:11:58] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\SessionListener::onKernelRequest". [] []
29573
+[2011-09-08 18:11:58] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest". [] []
29574
+[2011-09-08 18:11:58] security.INFO: Populated SecurityContext with an anonymous Token [] []
29575
+[2011-09-08 18:11:58] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\RouterListener::onKernelRequest". [] []
29576
+[2011-09-08 18:11:58] request.INFO: Matched route "index" (parameters: "_controller": "Muzich\IndexBundle\Controller\IndexController::indexAction", "_route": "index") [] []
29577
+[2011-09-08 18:11:58] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\AsseticBundle\EventListener\RequestListener::onKernelRequest". [] []
29578
+[2011-09-08 18:11:58] event.DEBUG: Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RequestDataCollector::onKernelController". [] []
29579
+[2011-09-08 18:11:58] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener::onKernelController". [] []
29580
+[2011-09-08 18:11:58] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener::onKernelController". [] []
29581
+[2011-09-08 18:11:58] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelController". [] []
29582
+[2011-09-08 18:11:58] event.DEBUG: Notified event "kernel.controller" to listener "Acme\DemoBundle\ControllerListener::onKernelController". [] []
29583
+[2011-09-08 18:11:58] event.DEBUG: Notified event "kernel.controller" to listener "JMS\SecurityExtraBundle\Controller\ControllerListener::onCoreController". [] []
29584
+[2011-09-08 18:11:59] doctrine.DEBUG: SELECT t0.username AS username1, t0.username_canonical AS username_canonical2, t0.email AS email3, t0.email_canonical AS email_canonical4, t0.enabled AS enabled5, t0.algorithm AS algorithm6, t0.salt AS salt7, t0.password AS password8, t0.last_login AS last_login9, t0.locked AS locked10, t0.expired AS expired11, t0.expires_at AS expires_at12, t0.confirmation_token AS confirmation_token13, t0.password_requested_at AS password_requested_at14, t0.roles AS roles15, t0.credentials_expired AS credentials_expired16, t0.credentials_expire_at AS credentials_expire_at17, t0.id AS id18 FROM muzich_user t0 WHERE t0.username = ? (["bux"]) [] []
29585
+[2011-09-08 18:11:59] doctrine.DEBUG: SELECT t0.id AS id1, t0.position AS position2, t0.user_id AS user_id3, t0.tag_id AS tag_id4 FROM users_tags_favorites t0 WHERE t0.user_id = ? ([1]) [] []
29586
+[2011-09-08 18:11:59] doctrine.DEBUG: SELECT t0.id AS id1, t0.name AS name2 FROM tag t0 WHERE t0.id = ? ([1]) [] []
29587
+[2011-09-08 18:11:59] doctrine.DEBUG: SELECT t0.id AS id1, t0.name AS name2 FROM tag t0 WHERE t0.id = ? ([2]) [] []
29588
+[2011-09-08 18:19:55] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\RouterListener::onEarlyKernelRequest". [] []
29589
+[2011-09-08 18:19:55] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\SessionListener::onKernelRequest". [] []
29590
+[2011-09-08 18:19:55] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest". [] []
29591
+[2011-09-08 18:19:55] security.INFO: Populated SecurityContext with an anonymous Token [] []
29592
+[2011-09-08 18:19:55] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\RouterListener::onKernelRequest". [] []
29593
+[2011-09-08 18:19:55] request.INFO: Matched route "index" (parameters: "_controller": "Muzich\IndexBundle\Controller\IndexController::indexAction", "_route": "index") [] []
29594
+[2011-09-08 18:19:55] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\AsseticBundle\EventListener\RequestListener::onKernelRequest". [] []
29595
+[2011-09-08 18:19:55] event.DEBUG: Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RequestDataCollector::onKernelController". [] []
29596
+[2011-09-08 18:19:55] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener::onKernelController". [] []
29597
+[2011-09-08 18:19:55] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener::onKernelController". [] []
29598
+[2011-09-08 18:19:55] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelController". [] []
29599
+[2011-09-08 18:19:55] event.DEBUG: Notified event "kernel.controller" to listener "Acme\DemoBundle\ControllerListener::onKernelController". [] []
29600
+[2011-09-08 18:19:55] event.DEBUG: Notified event "kernel.controller" to listener "JMS\SecurityExtraBundle\Controller\ControllerListener::onCoreController". [] []
29601
+[2011-09-08 18:19:56] doctrine.DEBUG: SELECT t0.username AS username1, t0.username_canonical AS username_canonical2, t0.email AS email3, t0.email_canonical AS email_canonical4, t0.enabled AS enabled5, t0.algorithm AS algorithm6, t0.salt AS salt7, t0.password AS password8, t0.last_login AS last_login9, t0.locked AS locked10, t0.expired AS expired11, t0.expires_at AS expires_at12, t0.confirmation_token AS confirmation_token13, t0.password_requested_at AS password_requested_at14, t0.roles AS roles15, t0.credentials_expired AS credentials_expired16, t0.credentials_expire_at AS credentials_expire_at17, t0.id AS id18 FROM muzich_user t0 WHERE t0.username = ? (["bux"]) [] []
29602
+[2011-09-08 18:19:56] doctrine.DEBUG: SELECT t0.id AS id1, t0.position AS position2, t0.user_id AS user_id3, t0.tag_id AS tag_id4 FROM users_tags_favorites t0 WHERE t0.user_id = ? ([1]) [] []
29603
+[2011-09-08 18:19:56] doctrine.DEBUG: SELECT t0.id AS id1, t0.name AS name2 FROM tag t0 WHERE t0.id = ? ([1]) [] []
29604
+[2011-09-08 18:19:56] doctrine.DEBUG: SELECT t0.id AS id1, t0.name AS name2 FROM tag t0 WHERE t0.id = ? ([2]) [] []
29605
+[2011-09-08 18:27:56] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\RouterListener::onEarlyKernelRequest". [] []
29606
+[2011-09-08 18:27:56] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\SessionListener::onKernelRequest". [] []
29607
+[2011-09-08 18:27:56] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest". [] []
29608
+[2011-09-08 18:27:56] security.INFO: Populated SecurityContext with an anonymous Token [] []
29609
+[2011-09-08 18:27:56] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\RouterListener::onKernelRequest". [] []
29610
+[2011-09-08 18:27:56] request.INFO: Matched route "index" (parameters: "_controller": "Muzich\IndexBundle\Controller\IndexController::indexAction", "_route": "index") [] []
29611
+[2011-09-08 18:27:56] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\AsseticBundle\EventListener\RequestListener::onKernelRequest". [] []
29612
+[2011-09-08 18:27:56] event.DEBUG: Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RequestDataCollector::onKernelController". [] []
29613
+[2011-09-08 18:27:56] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener::onKernelController". [] []
29614
+[2011-09-08 18:27:56] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener::onKernelController". [] []
29615
+[2011-09-08 18:27:56] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelController". [] []
29616
+[2011-09-08 18:27:56] event.DEBUG: Notified event "kernel.controller" to listener "Acme\DemoBundle\ControllerListener::onKernelController". [] []
29617
+[2011-09-08 18:27:56] event.DEBUG: Notified event "kernel.controller" to listener "JMS\SecurityExtraBundle\Controller\ControllerListener::onCoreController". [] []
29618
+[2011-09-08 18:27:56] doctrine.DEBUG: SELECT t0.username AS username1, t0.username_canonical AS username_canonical2, t0.email AS email3, t0.email_canonical AS email_canonical4, t0.enabled AS enabled5, t0.algorithm AS algorithm6, t0.salt AS salt7, t0.password AS password8, t0.last_login AS last_login9, t0.locked AS locked10, t0.expired AS expired11, t0.expires_at AS expires_at12, t0.confirmation_token AS confirmation_token13, t0.password_requested_at AS password_requested_at14, t0.roles AS roles15, t0.credentials_expired AS credentials_expired16, t0.credentials_expire_at AS credentials_expire_at17, t0.id AS id18 FROM muzich_user t0 WHERE t0.username = ? (["bux"]) [] []
29619
+[2011-09-08 18:27:56] doctrine.DEBUG: SELECT t0.id AS id1, t0.position AS position2, t0.user_id AS user_id3, t0.tag_id AS tag_id4 FROM users_tags_favorites t0 WHERE t0.user_id = ? ([1]) [] []
29620
+[2011-09-08 18:27:56] doctrine.DEBUG: SELECT t0.id AS id1, t0.name AS name2 FROM tag t0 WHERE t0.id = ? ([1]) [] []
29621
+[2011-09-08 18:27:56] doctrine.DEBUG: SELECT t0.id AS id1, t0.name AS name2 FROM tag t0 WHERE t0.id = ? ([2]) [] []

+ 49 - 36
src/Muzich/CoreBundle/Entity/Element.php View File

5
 use Doctrine\ORM\Mapping as ORM;
5
 use Doctrine\ORM\Mapping as ORM;
6
 
6
 
7
 /**
7
 /**
8
+ * L'Element est l'Element (huhu) central de l'application. C'est cet
9
+ * entité qui stocke le media partagé sur le réseau.
10
+ * 
8
  * @ORM\Entity
11
  * @ORM\Entity
9
  * @ORM\Table(name="element")
12
  * @ORM\Table(name="element")
10
  */
13
  */
12
 {
15
 {
13
   
16
   
14
   /**
17
   /**
18
+   * @ORM\Id
19
+   * @ORM\Column(type="integer")
20
+   * @ORM\GeneratedValue(strategy="AUTO")
21
+   * @var type int
22
+   */
23
+  protected $id;
24
+
25
+  /**
26
+   * Cet attribut stocke le type d'élément.
27
+   * 
15
    * @ORM\ManyToOne(targetEntity="ElementType", inversedBy="elements")
28
    * @ORM\ManyToOne(targetEntity="ElementType", inversedBy="elements")
16
    * @ORM\JoinColumn(name="element_type_id", referencedColumnName="id")
29
    * @ORM\JoinColumn(name="element_type_id", referencedColumnName="id")
17
    */
30
    */
18
   protected $type;
31
   protected $type;
19
   
32
   
20
   /**
33
   /**
34
+   * Cet attribut stocke la liste des tags liés a cet élément.
35
+   * 
21
    * @ORM\ManyToMany(targetEntity="Tag", inversedBy="elements")
36
    * @ORM\ManyToMany(targetEntity="Tag", inversedBy="elements")
22
    * @ORM\JoinTable(name="elements_tag")
37
    * @ORM\JoinTable(name="elements_tag")
23
    */
38
    */
24
   private $tags;
39
   private $tags;
25
   
40
   
26
   /**
41
   /**
27
-   * @ORM\Id
28
-   * @ORM\Column(type="integer")
29
-   * @ORM\GeneratedValue(strategy="AUTO")
30
-   * @var type int
31
-   */
32
-  protected $id;
33
-
34
-  /**
42
+   * L'url est l'url du media. 
43
+   * 
35
    * @ORM\Column(type="string", length=1024)
44
    * @ORM\Column(type="string", length=1024)
36
    * @var type string
45
    * @var type string
37
    */
46
    */
38
   protected $url;
47
   protected $url;
39
   
48
   
40
   /**
49
   /**
50
+   * Libellé du media
51
+   * 
41
    * @ORM\Column(type="string", length=128)
52
    * @ORM\Column(type="string", length=128)
42
    * @var type string
53
    * @var type string
43
    */
54
    */
44
   protected $name;
55
   protected $name;
45
   
56
   
46
   /**
57
   /**
58
+   * Date d'ajout dans le réseau
59
+   * 
47
    * @ORM\Column(type="datetime")
60
    * @ORM\Column(type="datetime")
48
    * @var type string
61
    * @var type string
49
    */
62
    */
57
    */
70
    */
58
   public function getId()
71
   public function getId()
59
   {
72
   {
60
-      return $this->id;
73
+    return $this->id;
61
   }
74
   }
62
 
75
 
63
   /**
76
   /**
67
    */
80
    */
68
   public function setUrl($url)
81
   public function setUrl($url)
69
   {
82
   {
70
-      $this->url = $url;
83
+    $this->url = $url;
71
   }
84
   }
72
 
85
 
73
   /**
86
   /**
77
    */
90
    */
78
   public function getUrl()
91
   public function getUrl()
79
   {
92
   {
80
-      return $this->url;
93
+    return $this->url;
81
   }
94
   }
82
 
95
 
83
   /**
96
   /**
87
    */
100
    */
88
   public function setName($name)
101
   public function setName($name)
89
   {
102
   {
90
-      $this->name = $name;
103
+    $this->name = $name;
91
   }
104
   }
92
 
105
 
93
   /**
106
   /**
97
    */
110
    */
98
   public function getName()
111
   public function getName()
99
   {
112
   {
100
-      return $this->name;
113
+    return $this->name;
101
   }
114
   }
102
 
115
 
103
   /**
116
   /**
107
    */
120
    */
108
   public function setDateAdded($dateAdded)
121
   public function setDateAdded($dateAdded)
109
   {
122
   {
110
-      $this->date_added = $dateAdded;
123
+    $this->date_added = $dateAdded;
111
   }
124
   }
112
 
125
 
113
   /**
126
   /**
117
    */
130
    */
118
   public function getDateAdded()
131
   public function getDateAdded()
119
   {
132
   {
120
-      return $this->date_added;
133
+    return $this->date_added;
121
   }
134
   }
122
   
135
   
123
   /**
136
   /**
127
    */
140
    */
128
   public function setType(\Muzich\CoreBundle\Entity\ElementType $type)
141
   public function setType(\Muzich\CoreBundle\Entity\ElementType $type)
129
   {
142
   {
130
-      $this->type = $type;
143
+    $this->type = $type;
131
   }
144
   }
132
 
145
 
133
   /**
146
   /**
137
    */
150
    */
138
   public function getType()
151
   public function getType()
139
   {
152
   {
140
-      return $this->type;
153
+    return $this->type;
141
   }
154
   }
142
   
155
   
143
   
156
   
146
     $this->tags = new \Doctrine\Common\Collections\ArrayCollection();
159
     $this->tags = new \Doctrine\Common\Collections\ArrayCollection();
147
   }
160
   }
148
   
161
   
162
+  /**
163
+   * Add tags
164
+   *
165
+   * @param Muzich\CoreBundle\Entity\Tag $tags
166
+   */
167
+  public function addTag(\Muzich\CoreBundle\Entity\Tag $tags)
168
+  {
169
+    $this->tags[] = $tags;
170
+  }
149
 
171
 
150
-    /**
151
-     * Add tags
152
-     *
153
-     * @param Muzich\CoreBundle\Entity\Tag $tags
154
-     */
155
-    public function addTag(\Muzich\CoreBundle\Entity\Tag $tags)
156
-    {
157
-        $this->tags[] = $tags;
158
-    }
159
-
160
-    /**
161
-     * Get tags
162
-     *
163
-     * @return Doctrine\Common\Collections\Collection 
164
-     */
165
-    public function getTags()
166
-    {
167
-        return $this->tags;
168
-    }
172
+  /**
173
+   * Get tags
174
+   *
175
+   * @return Doctrine\Common\Collections\Collection 
176
+   */
177
+  public function getTags()
178
+  {
179
+    return $this->tags;
180
+  }
181
+  
169
 }
182
 }

+ 25 - 14
src/Muzich/CoreBundle/Entity/ElementType.php View File

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

+ 20 - 11
src/Muzich/CoreBundle/Entity/Tag.php View File

3
 namespace Muzich\CoreBundle\Entity;
3
 namespace Muzich\CoreBundle\Entity;
4
 
4
 
5
 use Doctrine\ORM\Mapping as ORM;
5
 use Doctrine\ORM\Mapping as ORM;
6
+use \Doctrine\Common\Collections\ArrayCollection;
6
 
7
 
7
 /**
8
 /**
9
+ * Cet entité représente le Tag.
10
+ * 
8
  * @ORM\Entity
11
  * @ORM\Entity
9
  * @ORM\Table(name="tag")
12
  * @ORM\Table(name="tag")
10
  */
13
  */
12
 {
15
 {
13
   
16
   
14
   /**
17
   /**
18
+   * @ORM\Id
19
+   * @ORM\Column(type="integer")
20
+   * @ORM\GeneratedValue(strategy="AUTO")
21
+   * @var type int
22
+   */
23
+  protected $id;
24
+  
25
+  /**
26
+   * Cet attribu stocke la liste des élèments liés a ce tag.
27
+   * 
15
    * @ORM\ManyToMany(targetEntity="Element", mappedBy="tags")
28
    * @ORM\ManyToMany(targetEntity="Element", mappedBy="tags")
16
    */
29
    */
17
   protected $elements;
30
   protected $elements;
18
   
31
   
19
   /**
32
   /**
33
+   * Cet attribu stocke les enregistrements UsersTagsFavorites liés
34
+   * a ce Tag dans le cadre des Tags favoris.
35
+   * 
20
    * @ORM\OneToMany(targetEntity="UsersTagsFavorites", mappedBy="tag")
36
    * @ORM\OneToMany(targetEntity="UsersTagsFavorites", mappedBy="tag")
21
    */
37
    */
22
   protected $users_favorites;
38
   protected $users_favorites;
23
-  
24
-  /**
25
-   * @ORM\Id
26
-   * @ORM\Column(type="integer")
27
-   * @ORM\GeneratedValue(strategy="AUTO")
28
-   * @var type int
29
-   */
30
-  protected $id;
31
-  
32
   /**
39
   /**
40
+   * Nom du tag
41
+   * 
33
    * @ORM\Column(type="string", length=32)
42
    * @ORM\Column(type="string", length=32)
34
    * @var type string
43
    * @var type string
35
    */
44
    */
40
    */
49
    */
41
   public function __construct()
50
   public function __construct()
42
   {
51
   {
43
-    $this->users_favorites = new \Doctrine\Common\Collections\ArrayCollection();
44
-    $this->elements = new \Doctrine\Common\Collections\ArrayCollection();
52
+    $this->users_favorites = new ArrayCollection();
53
+    $this->elements = new ArrayCollection();
45
   }
54
   }
46
   
55
   
47
 
56
 

+ 54 - 47
src/Muzich/CoreBundle/Entity/UsersTagsFavorites.php View File

5
 use Doctrine\ORM\Mapping as ORM;
5
 use Doctrine\ORM\Mapping as ORM;
6
 
6
 
7
 /**
7
 /**
8
+ * Cette classe représente la relation porteuse entre User et Tag, 
9
+ * en tant que Tags favoris de l'utilisateur.
10
+ * 
8
  * @ORM\Entity
11
  * @ORM\Entity
9
  * @ORM\Table(name="users_tags_favorites")
12
  * @ORM\Table(name="users_tags_favorites")
10
  */
13
  */
12
 {
15
 {
13
   
16
   
14
   /**
17
   /**
18
+   * @ORM\Id
19
+   * @ORM\Column(type="integer")
20
+   * @ORM\GeneratedValue(strategy="AUTO")
21
+   * @var type int
22
+   */
23
+  protected $id;
24
+  
25
+  /**
26
+   * Cet attribut contient l'objet User lié
27
+   * 
15
    * @ORM\ManyToOne(targetEntity="Muzich\UserBundle\Entity\User", inversedBy="tags")
28
    * @ORM\ManyToOne(targetEntity="Muzich\UserBundle\Entity\User", inversedBy="tags")
16
    * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
29
    * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
17
    */
30
    */
18
   protected $user;
31
   protected $user;
19
   
32
   
20
   /**
33
   /**
34
+   * Cet attribut contient l'objet Tag lié
35
+   * 
21
    * @ORM\ManyToOne(targetEntity="Tag", inversedBy="users")
36
    * @ORM\ManyToOne(targetEntity="Tag", inversedBy="users")
22
    * @ORM\JoinColumn(name="tag_id", referencedColumnName="id")
37
    * @ORM\JoinColumn(name="tag_id", referencedColumnName="id")
23
    */
38
    */
24
   protected $tag;
39
   protected $tag;
25
   
40
   
26
-  
27
-  /**
28
-   * @ORM\Id
29
-   * @ORM\Column(type="integer")
30
-   * @ORM\GeneratedValue(strategy="AUTO")
31
-   * @var type int
32
-   */
33
-  protected $id;
34
-  
35
   /**
41
   /**
42
+   * L'attribut position permet de connaitre l'ordre de préfèrence de 
43
+   * l'utilisateur.
44
+   * 
36
    * @ORM\Column(type="integer")
45
    * @ORM\Column(type="integer")
37
    * @var type int
46
    * @var type int
38
    */
47
    */
70
       return $this->id;
79
       return $this->id;
71
   }
80
   }
72
 
81
 
82
+  /**
83
+   * Set user
84
+   *
85
+   * @param Muzich\UserBundle\Entity\User $user
86
+   */
87
+  public function setUser(Muzich\UserBundle\Entity\User $user)
88
+  {
89
+    $this->user = $user;
90
+  }
73
 
91
 
92
+  /**
93
+   * Get user
94
+   *
95
+   * @return Muzich\UserBundle\Entity\User 
96
+   */
97
+  public function getUser()
98
+  {
99
+    return $this->user;
100
+  }
74
 
101
 
75
-    /**
76
-     * Set user
77
-     *
78
-     * @param Muzich\UserBundle\Entity\User $user
79
-     */
80
-    public function setUser(Muzich\UserBundle\Entity\User $user)
81
-    {
82
-        $this->user = $user;
83
-    }
84
-
85
-    /**
86
-     * Get user
87
-     *
88
-     * @return Muzich\UserBundle\Entity\User 
89
-     */
90
-    public function getUser()
91
-    {
92
-        return $this->user;
93
-    }
94
-
95
-    /**
96
-     * Set tag
97
-     *
98
-     * @param Muzich\CoreBundle\Entity\Tag $tag
99
-     */
100
-    public function setTag(Muzich\CoreBundle\Entity\Tag $tag)
101
-    {
102
-        $this->tag = $tag;
103
-    }
102
+  /**
103
+   * Set tag
104
+   *
105
+   * @param Muzich\CoreBundle\Entity\Tag $tag
106
+   */
107
+  public function setTag(Muzich\CoreBundle\Entity\Tag $tag)
108
+  {
109
+    $this->tag = $tag;
110
+  }
104
 
111
 
105
-    /**
106
-     * Get tag
107
-     *
108
-     * @return Muzich\CoreBundle\Entity\Tag 
109
-     */
110
-    public function getTag()
111
-    {
112
-        return $this->tag;
113
-    }
112
+  /**
113
+   * Get tag
114
+   *
115
+   * @return Muzich\CoreBundle\Entity\Tag 
116
+   */
117
+  public function getTag()
118
+  {
119
+    return $this->tag;
120
+  }
114
 }
121
 }

+ 17 - 20
src/Muzich/UserBundle/Entity/User.php View File

4
 
4
 
5
 use FOS\UserBundle\Entity\User as BaseUser;
5
 use FOS\UserBundle\Entity\User as BaseUser;
6
 use Doctrine\ORM\Mapping as ORM;
6
 use Doctrine\ORM\Mapping as ORM;
7
+use \Doctrine\Common\Collections\ArrayCollection;
7
 
8
 
8
 /**
9
 /**
10
+ * Cet entité est l'utilisateur ayant effectué la requête.
11
+ * 
9
  * @ORM\Entity
12
  * @ORM\Entity
10
  * @ORM\Table(name="muzich_user")
13
  * @ORM\Table(name="muzich_user")
11
  */
14
  */
12
 class User extends BaseUser
15
 class User extends BaseUser
13
 {
16
 {
14
   
17
   
15
-  /**
16
-   * @ORM\OneToMany(targetEntity="Muzich\CoreBundle\Entity\UsersTagsFavorites", mappedBy="user")
17
-   */
18
-  private $tags_favorites;
19
-  
20
  /**
18
  /**
21
   * @ORM\Id
19
   * @ORM\Id
22
   * @ORM\Column(type="integer")
20
   * @ORM\Column(type="integer")
23
   * @ORM\generatedValue(strategy="AUTO")
21
   * @ORM\generatedValue(strategy="AUTO")
24
   */
22
   */
25
   protected $id;
23
   protected $id;
24
+  
25
+  /**
26
+   * Cet attribut contient les enregistrements UsersTagsFavorites lié 
27
+   * a cet utilisateur dans le cadre des Tags Favoris.
28
+   * 
29
+   * @ORM\OneToMany(targetEntity="Muzich\CoreBundle\Entity\UsersTagsFavorites", mappedBy="user")
30
+   */
31
+  private $tags_favorites;
26
 
32
 
33
+  /**
34
+   * 
35
+   */
27
   public function __construct()
36
   public function __construct()
28
   {
37
   {
29
-    $this->tags_favorites = new \Doctrine\Common\Collections\ArrayCollection();
38
+    $this->tags_favorites = new ArrayCollection();
30
     parent::__construct();
39
     parent::__construct();
31
   }
40
   }
32
 
41
 
39
   {
48
   {
40
     return $this->id;
49
     return $this->id;
41
   }
50
   }
42
-  
43
-
44
-  /**
45
-   * Add tags_favorites
46
-   *
47
-   * @param Muzich\UserBundle\Entity\Tag $tagsFavorites
48
-   */
49
-  public function addTag(Muzich\CoreBundle\Entity\UsersTagsFavorites $tagsFavorites)
50
-  {
51
-      $this->tags_favorites[] = $tagsFavorites;
52
-  }
53
 
51
 
54
   /**
52
   /**
55
    * Get tags_favorites
53
    * Get tags_favorites
58
    */
56
    */
59
   public function getTagsFavorites()
57
   public function getTagsFavorites()
60
   {
58
   {
61
-      return $this->tags_favorites;
59
+    return $this->tags_favorites;
62
   }
60
   }
63
   
61
   
64
-
65
   /**
62
   /**
66
    * Add tags_favorites
63
    * Add tags_favorites
67
    *
64
    *
69
    */
66
    */
70
   public function addUsersTagsFavorites(Muzich\CoreBundle\Entity\UsersTagsFavorites $tagsFavorites)
67
   public function addUsersTagsFavorites(Muzich\CoreBundle\Entity\UsersTagsFavorites $tagsFavorites)
71
   {
68
   {
72
-      $this->tags_favorites[] = $tagsFavorites;
69
+    $this->tags_favorites[] = $tagsFavorites;
73
   }
70
   }
74
 }
71
 }