diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/Entry.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/Entry.php | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 1b4367fd..62274136 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php | |||
@@ -28,7 +28,8 @@ use Wallabag\UserBundle\Entity\User; | |||
28 | * @ORM\Index(name="created_at", columns={"created_at"}), | 28 | * @ORM\Index(name="created_at", columns={"created_at"}), |
29 | * @ORM\Index(name="uid", columns={"uid"}), | 29 | * @ORM\Index(name="uid", columns={"uid"}), |
30 | * @ORM\Index(name="hashed_url_user_id", columns={"user_id", "hashed_url"}, options={"lengths"={null, 40}}) | 30 | * @ORM\Index(name="hashed_url_user_id", columns={"user_id", "hashed_url"}, options={"lengths"={null, 40}}) |
31 | * } | 31 | * }, |
32 | * uniqueConstraints={@ORM\UniqueConstraint(name="IDX_entry_given_url",columns={"url", "given_url", "user_id"})} | ||
32 | * ) | 33 | * ) |
33 | * @ORM\HasLifecycleCallbacks() | 34 | * @ORM\HasLifecycleCallbacks() |
34 | * @Hateoas\Relation("self", href = "expr('/api/entries/' ~ object.getId())") | 35 | * @Hateoas\Relation("self", href = "expr('/api/entries/' ~ object.getId())") |
@@ -70,6 +71,15 @@ class Entry | |||
70 | /** | 71 | /** |
71 | * @var string | 72 | * @var string |
72 | * | 73 | * |
74 | * @ORM\Column(name="given_url", type="text", nullable=true) | ||
75 | * | ||
76 | * @Groups({"entries_for_user", "export_all"}) | ||
77 | */ | ||
78 | private $givenUrl; | ||
79 | |||
80 | /** | ||
81 | * @var string | ||
82 | * | ||
73 | * @Assert\NotBlank() | 83 | * @Assert\NotBlank() |
74 | * @ORM\Column(name="url", type="text", nullable=true) | 84 | * @ORM\Column(name="url", type="text", nullable=true) |
75 | * | 85 | * |
@@ -316,6 +326,30 @@ class Entry | |||
316 | } | 326 | } |
317 | 327 | ||
318 | /** | 328 | /** |
329 | * Set given url. | ||
330 | * | ||
331 | * @param string $givenUrl | ||
332 | * | ||
333 | * @return Entry | ||
334 | */ | ||
335 | public function setGivenUrl($givenUrl) | ||
336 | { | ||
337 | $this->givenUrl = $givenUrl; | ||
338 | |||
339 | return $this; | ||
340 | } | ||
341 | |||
342 | /** | ||
343 | * Get given Url. | ||
344 | * | ||
345 | * @return string | ||
346 | */ | ||
347 | public function getGivenUrl() | ||
348 | { | ||
349 | return $this->givenUrl; | ||
350 | } | ||
351 | |||
352 | /** | ||
319 | * Set url. | 353 | * Set url. |
320 | * | 354 | * |
321 | * @param string $url | 355 | * @param string $url |