diff options
author | Thomas Citharel <tcit@tcit.fr> | 2017-05-28 14:53:04 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2019-04-01 13:24:40 +0200 |
commit | bfe02a0b481055bb4e799200c8daa9a0ad987c71 (patch) | |
tree | b82431b5ca4b24de1ddab6f0407e1ae7cda54083 /src/Wallabag/CoreBundle/Entity | |
parent | 3620dae1e6b3fab5a4ba4001b4581ce7ed795996 (diff) | |
download | wallabag-bfe02a0b481055bb4e799200c8daa9a0ad987c71.tar.gz wallabag-bfe02a0b481055bb4e799200c8daa9a0ad987c71.tar.zst wallabag-bfe02a0b481055bb4e799200c8daa9a0ad987c71.zip |
Hash the urls to check if they exist
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity')
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/Entry.php | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index b3cfdc4a..17a1ed58 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php | |||
@@ -25,7 +25,8 @@ use Wallabag\UserBundle\Entity\User; | |||
25 | * options={"collate"="utf8mb4_unicode_ci", "charset"="utf8mb4"}, | 25 | * options={"collate"="utf8mb4_unicode_ci", "charset"="utf8mb4"}, |
26 | * indexes={ | 26 | * indexes={ |
27 | * @ORM\Index(name="created_at", columns={"created_at"}), | 27 | * @ORM\Index(name="created_at", columns={"created_at"}), |
28 | * @ORM\Index(name="uid", columns={"uid"}) | 28 | * @ORM\Index(name="uid", columns={"uid"}), |
29 | * @ORM\Index(name="hashedurl", columns={"hashedurl"}) | ||
29 | * } | 30 | * } |
30 | * ) | 31 | * ) |
31 | * @ORM\HasLifecycleCallbacks() | 32 | * @ORM\HasLifecycleCallbacks() |
@@ -76,6 +77,13 @@ class Entry | |||
76 | private $url; | 77 | private $url; |
77 | 78 | ||
78 | /** | 79 | /** |
80 | * @var string | ||
81 | * | ||
82 | * @ORM\Column(name="hashedurl", type="text", nullable=true) | ||
83 | */ | ||
84 | private $hashedUrl; | ||
85 | |||
86 | /** | ||
79 | * @var bool | 87 | * @var bool |
80 | * | 88 | * |
81 | * @Exclude | 89 | * @Exclude |
@@ -911,4 +919,24 @@ class Entry | |||
911 | { | 919 | { |
912 | return $this->originUrl; | 920 | return $this->originUrl; |
913 | } | 921 | } |
922 | |||
923 | /** | ||
924 | * @return string | ||
925 | */ | ||
926 | public function getHashedUrl() | ||
927 | { | ||
928 | return $this->hashedUrl; | ||
929 | } | ||
930 | |||
931 | /** | ||
932 | * @param mixed $hashedUrl | ||
933 | * | ||
934 | * @return Entry | ||
935 | */ | ||
936 | public function setHashedUrl($hashedUrl) | ||
937 | { | ||
938 | $this->hashedUrl = $hashedUrl; | ||
939 | |||
940 | return $this; | ||
941 | } | ||
914 | } | 942 | } |