Browse Source

Antités ElementType et Tag suite.

bastien 13 years ago
parent
commit
61d39e499c
2 changed files with 135 additions and 0 deletions
  1. 97 0
      src/Muzich/CoreBundle/Entity/ElementType.php
  2. 38 0
      src/Muzich/CoreBundle/Entity/Tag.php

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

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

+ 38 - 0
src/Muzich/CoreBundle/Entity/Tag.php View File

@@ -0,0 +1,38 @@
1
+<?php
2
+
3
+namespace Muzich\CoreBundle\Entity;
4
+
5
+use Doctrine\ORM\Mapping as ORM;
6
+
7
+/**
8
+ * @ORM\Entity
9
+ * @ORM\Table(name="tag")
10
+ */
11
+class Tag
12
+{
13
+  
14
+  /**
15
+   * @ManyToMany(targetEntity="Tag", mappedBy="tags")
16
+   */
17
+  private $elements;
18
+  
19
+  /**
20
+   * @ORM\Id
21
+   * @ORM\Column(type="integer")
22
+   * @ORM\GeneratedValue(strategy="AUTO")
23
+   * @var type int
24
+   */
25
+  protected $id;
26
+  
27
+  /**
28
+   * @ORM\Column(type="string", length=32)
29
+   * @var type string
30
+   */
31
+  protected $name;
32
+  
33
+  public function __construct()
34
+  {
35
+    $this->elements = new \Doctrine\Common\Collections\ArrayCollection();
36
+  }
37
+  
38
+}