diff options
Diffstat (limited to 'src/Wallabag')
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/Entry.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index bd712a04..5e608f05 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php | |||
@@ -7,6 +7,9 @@ use Doctrine\ORM\Mapping as ORM; | |||
7 | use Hateoas\Configuration\Annotation as Hateoas; | 7 | use Hateoas\Configuration\Annotation as Hateoas; |
8 | use JMS\Serializer\Annotation\Groups; | 8 | use JMS\Serializer\Annotation\Groups; |
9 | use JMS\Serializer\Annotation\XmlRoot; | 9 | use JMS\Serializer\Annotation\XmlRoot; |
10 | use JMS\Serializer\Annotation\Exclude; | ||
11 | use JMS\Serializer\Annotation\VirtualProperty; | ||
12 | use JMS\Serializer\Annotation\SerializedName; | ||
10 | use Symfony\Component\Validator\Constraints as Assert; | 13 | use Symfony\Component\Validator\Constraints as Assert; |
11 | use Wallabag\UserBundle\Entity\User; | 14 | use Wallabag\UserBundle\Entity\User; |
12 | use Wallabag\AnnotationBundle\Entity\Annotation; | 15 | use Wallabag\AnnotationBundle\Entity\Annotation; |
@@ -161,6 +164,8 @@ class Entry | |||
161 | private $isPublic; | 164 | private $isPublic; |
162 | 165 | ||
163 | /** | 166 | /** |
167 | * @Exclude | ||
168 | * | ||
164 | * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="entries") | 169 | * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="entries") |
165 | * | 170 | * |
166 | * @Groups({"export_all"}) | 171 | * @Groups({"export_all"}) |
@@ -337,6 +342,33 @@ class Entry | |||
337 | } | 342 | } |
338 | 343 | ||
339 | /** | 344 | /** |
345 | * @VirtualProperty | ||
346 | * @SerializedName("user_name") | ||
347 | */ | ||
348 | public function getUserName() | ||
349 | { | ||
350 | return $this->user->getUserName(); | ||
351 | } | ||
352 | |||
353 | /** | ||
354 | * @VirtualProperty | ||
355 | * @SerializedName("user_email") | ||
356 | */ | ||
357 | public function getUserEmail() | ||
358 | { | ||
359 | return $this->user->getEmail(); | ||
360 | } | ||
361 | |||
362 | /** | ||
363 | * @VirtualProperty | ||
364 | * @SerializedName("user_id") | ||
365 | */ | ||
366 | public function getUserId() | ||
367 | { | ||
368 | return $this->user->getId(); | ||
369 | } | ||
370 | |||
371 | /** | ||
340 | * @return string | 372 | * @return string |
341 | */ | 373 | */ |
342 | public function getCreatedAt() | 374 | public function getCreatedAt() |