1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Victoire\Bundle\BlogBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
use Gedmo\Mapping\Annotation as Gedmo; |
7
|
|
|
use JMS\Serializer\Annotation as Serializer; |
8
|
|
|
use Knp\DoctrineBehaviors\Model\Translatable\Translation; |
9
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
10
|
|
|
use Victoire\Bundle\CoreBundle\Annotations as VIC; |
11
|
|
|
use Victoire\Bundle\MediaBundle\Entity\Media; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* Victoire ViewTranslation. |
15
|
|
|
* |
16
|
|
|
* @ORM\Entity() |
17
|
|
|
* @ORM\Table(name="vic_article_translations") |
18
|
|
|
*/ |
19
|
|
|
class ArticleTranslation |
20
|
|
|
{ |
21
|
|
|
use Translation; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @var string |
25
|
|
|
* |
26
|
|
|
* @Assert\NotBlank() |
27
|
|
|
* @ORM\Column(name="name", type="string", length=255) |
28
|
|
|
* @Serializer\Groups({"search"}) |
29
|
|
|
* @VIC\BusinessProperty({"textable", "businessParameter", "seoable"}) |
30
|
|
|
*/ |
31
|
|
|
protected $name; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var string |
35
|
|
|
* |
36
|
|
|
* @Gedmo\Slug(handlers={ |
37
|
|
|
* @Gedmo\SlugHandler(class="Victoire\Bundle\BusinessEntityBundle\Handler\TwigSlugHandler" |
38
|
|
|
* )},fields={"name"}, updatable=false, unique=false) |
39
|
|
|
* @ORM\Column(name="slug", type="string", length=255) |
40
|
|
|
* @VIC\BusinessProperty("businessParameter") |
41
|
|
|
*/ |
42
|
|
|
protected $slug; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @var string |
46
|
|
|
* |
47
|
|
|
* @ORM\ManyToOne(targetEntity="\Victoire\Bundle\MediaBundle\Entity\Media") |
48
|
|
|
* @ORM\JoinColumn(name="image_id", referencedColumnName="id", onDelete="CASCADE") |
49
|
|
|
* @VIC\BusinessProperty("imageable") |
50
|
|
|
*/ |
51
|
|
|
private $image; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @var string |
55
|
|
|
* |
56
|
|
|
* @ORM\Column(name="description", type="text", nullable=true) |
57
|
|
|
* @VIC\BusinessProperty({"textable", "seoable"}) |
58
|
|
|
*/ |
59
|
|
|
private $description; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Get name. |
63
|
|
|
* |
64
|
|
|
* @return string |
65
|
|
|
*/ |
66
|
|
|
public function getName() |
67
|
|
|
{ |
68
|
|
|
return $this->name; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* Set name. |
73
|
|
|
* |
74
|
|
|
* @param string $name |
75
|
|
|
* |
76
|
|
|
* @return View |
77
|
|
|
*/ |
78
|
|
|
public function setName($name) |
79
|
|
|
{ |
80
|
|
|
$this->name = $name; |
81
|
|
|
|
82
|
|
|
return $this; |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* Set slug. |
87
|
|
|
* |
88
|
|
|
* @param string $slug |
89
|
|
|
* |
90
|
|
|
* @return View |
91
|
|
|
*/ |
92
|
|
|
public function setSlug($slug) |
93
|
|
|
{ |
94
|
|
|
$this->slug = $slug; |
95
|
|
|
|
96
|
|
|
return $this; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* Get slug. |
101
|
|
|
* |
102
|
|
|
* @return string |
103
|
|
|
*/ |
104
|
|
|
public function getSlug() |
105
|
|
|
{ |
106
|
|
|
return $this->slug; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* Get description. |
111
|
|
|
* |
112
|
|
|
* @return string |
113
|
|
|
*/ |
114
|
|
|
public function getDescription() |
115
|
|
|
{ |
116
|
|
|
return $this->description; |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
/** |
120
|
|
|
* Set category. |
121
|
|
|
* |
122
|
|
|
* @param string $category |
|
|
|
|
123
|
|
|
* |
124
|
|
|
* @return Article |
125
|
|
|
*/ |
126
|
|
|
public function setDescription($description) |
127
|
|
|
{ |
128
|
|
|
$this->description = $description; |
129
|
|
|
|
130
|
|
|
return $this; |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
/** |
134
|
|
|
* Set image. |
135
|
|
|
* |
136
|
|
|
* @param Media $image |
137
|
|
|
* |
138
|
|
|
* @return ArticleTranslation |
139
|
|
|
*/ |
140
|
|
|
public function setImage(Media $image = null) |
141
|
|
|
{ |
142
|
|
|
$this->image = $image; |
|
|
|
|
143
|
|
|
|
144
|
|
|
return $this; |
145
|
|
|
} |
146
|
|
|
|
147
|
|
|
/** |
148
|
|
|
* Get image. |
149
|
|
|
* |
150
|
|
|
* @return string |
151
|
|
|
*/ |
152
|
|
|
public function getImage() |
153
|
|
|
{ |
154
|
|
|
return $this->image; |
155
|
|
|
} |
156
|
|
|
} |
157
|
|
|
|
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.