| 1 | <?php |
||
| 13 | class Category |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @ORM\Column(type="integer") |
||
| 17 | * @ORM\Id |
||
| 18 | * @ORM\GeneratedValue(strategy="AUTO") |
||
| 19 | */ |
||
| 20 | private $id; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @ORM\Column(type="string", length=50, nullable=false) |
||
| 24 | */ |
||
| 25 | private $name; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @ORM\ManyToMany(targetEntity="Client", mappedBy="categories") |
||
| 29 | */ |
||
| 30 | private $clients; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Constructor |
||
| 34 | */ |
||
| 35 | public function __construct() |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Get id |
||
| 42 | * |
||
| 43 | * @return integer |
||
| 44 | */ |
||
| 45 | public function getId() |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Set name |
||
| 52 | * |
||
| 53 | * @param string $name |
||
| 54 | * |
||
| 55 | * @return Category |
||
| 56 | */ |
||
| 57 | public function setName($name) |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Get name |
||
| 66 | * |
||
| 67 | * @return string |
||
| 68 | */ |
||
| 69 | public function getName() |
||
| 73 | |||
| 74 | /** |
||
| 75 | * @return string |
||
| 76 | */ |
||
| 77 | public function __toString() |
||
| 81 | |||
| 82 | /** |
||
| 83 | * Add client |
||
| 84 | * |
||
| 85 | * @param \ClientBundle\Entity\Client $client |
||
| 86 | * |
||
| 87 | * @return Category |
||
| 88 | */ |
||
| 89 | public function addClient(\ClientBundle\Entity\Client $client) |
||
| 95 | |||
| 96 | /** |
||
| 97 | * Remove client |
||
| 98 | * |
||
| 99 | * @param \ClientBundle\Entity\Client $client |
||
| 100 | */ |
||
| 101 | public function removeClient(\ClientBundle\Entity\Client $client) |
||
| 105 | |||
| 106 | /** |
||
| 107 | * Get clients |
||
| 108 | * |
||
| 109 | * @return \Doctrine\Common\Collections\Collection |
||
| 110 | */ |
||
| 111 | public function getClients() |
||
| 115 | } |
||
| 116 |