| 1 | <?php |
||
| 10 | class Tag |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var int Id |
||
| 14 | * @Id @Column(type="integer") @GeneratedValue |
||
| 15 | */ |
||
| 16 | protected $id; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var string Name |
||
| 20 | * @Column(type="string", unique=true) |
||
| 21 | */ |
||
| 22 | protected $name; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var ArrayCollection Posts |
||
| 26 | * @ManyToMany(targetEntity="Post", mappedBy="tags") |
||
| 27 | */ |
||
| 28 | protected $posts; |
||
| 29 | |||
| 30 | public function __construct() |
||
| 34 | |||
| 35 | public function getId() |
||
| 39 | |||
| 40 | public function getName() |
||
| 44 | |||
| 45 | public function setName($name) |
||
| 49 | |||
| 50 | public function getPosts() |
||
| 54 | } |
||
| 55 |