aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2016-03-13 20:17:52 +0100
committerThomas Citharel <tcit@tcit.fr>2016-03-13 20:17:52 +0100
commit7d1fdab2bb918cb82b926c2079e15d779f42018c (patch)
treea52e62f18a024981864f879d7a0fffab273e28ee /src/Wallabag/CoreBundle/Entity
parent6ab56c7b2c225b74b000e9ecedfe28aa0f8d1e18 (diff)
downloadwallabag-7d1fdab2bb918cb82b926c2079e15d779f42018c.tar.gz
wallabag-7d1fdab2bb918cb82b926c2079e15d779f42018c.tar.zst
wallabag-7d1fdab2bb918cb82b926c2079e15d779f42018c.zip
API shows just what needed for user
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity')
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entry.php32
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;
7use Hateoas\Configuration\Annotation as Hateoas; 7use Hateoas\Configuration\Annotation as Hateoas;
8use JMS\Serializer\Annotation\Groups; 8use JMS\Serializer\Annotation\Groups;
9use JMS\Serializer\Annotation\XmlRoot; 9use JMS\Serializer\Annotation\XmlRoot;
10use JMS\Serializer\Annotation\Exclude;
11use JMS\Serializer\Annotation\VirtualProperty;
12use JMS\Serializer\Annotation\SerializedName;
10use Symfony\Component\Validator\Constraints as Assert; 13use Symfony\Component\Validator\Constraints as Assert;
11use Wallabag\UserBundle\Entity\User; 14use Wallabag\UserBundle\Entity\User;
12use Wallabag\AnnotationBundle\Entity\Annotation; 15use 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()