* indexes={
* @ORM\Index(name="created_at", columns={"created_at"}),
* @ORM\Index(name="uid", columns={"uid"}),
- * @ORM\Index(name="hashed_url_user_id", columns={"user_id", "hashed_url"}, options={"lengths"={null, 40}})
+ * @ORM\Index(name="hashed_url_user_id", columns={"user_id", "hashed_url"}, options={"lengths"={null, 40}}),
+ * @ORM\Index(name="hashed_given_url_user_id", columns={"user_id", "hashed_given_url"}, options={"lengths"={null, 40}}),
+ * @ORM\Index(name="user_language", columns={"language", "user_id"}),
+ * @ORM\Index(name="user_archived", columns={"user_id", "is_archived", "archived_at"}),
+ * @ORM\Index(name="user_created", columns={"user_id", "created_at"}),
+ * @ORM\Index(name="user_starred", columns={"user_id", "is_starred", "starred_at"})
* }
* )
* @ORM\HasLifecycleCallbacks()
private $title;
/**
+ * Define the url fetched by wallabag (the final url after potential redirections).
+ *
* @var string
*
* @Assert\NotBlank()
*/
private $hashedUrl;
+ /**
+ * From where user retrieved/found the url (an other article, a twitter, or the given_url if non are provided).
+ *
+ * @var string
+ *
+ * @ORM\Column(name="origin_url", type="text", nullable=true)
+ *
+ * @Groups({"entries_for_user", "export_all"})
+ */
+ private $originUrl;
+
+ /**
+ * Define the url entered by the user (without redirections).
+ *
+ * @var string
+ *
+ * @ORM\Column(name="given_url", type="text", nullable=true)
+ *
+ * @Groups({"entries_for_user", "export_all"})
+ */
+ private $givenUrl;
+
+ /**
+ * @var string
+ *
+ * @ORM\Column(name="hashed_given_url", type="string", length=40, nullable=true)
+ */
+ private $hashedGivenUrl;
+
/**
* @var bool
*
/**
* @var string
*
- * @ORM\Column(name="language", type="text", nullable=true)
+ * @ORM\Column(name="language", type="string", length=20, nullable=true)
*
* @Groups({"entries_for_user", "export_all"})
*/
*/
private $tags;
- /**
- * @var string
- *
- * @ORM\Column(name="origin_url", type="text", nullable=true)
- *
- * @Groups({"entries_for_user", "export_all"})
- */
- private $originUrl;
-
/*
* @param User $user
*/
* Set created_at.
* Only used when importing data from an other service.
*
- * @param \DateTime $createdAt
- *
* @return Entry
*/
public function setCreatedAt(\DateTime $createdAt)
return $this->annotations;
}
- /**
- * @param Annotation $annotation
- */
public function setAnnotation(Annotation $annotation)
{
$this->annotations[] = $annotation;
return $data;
}
- /**
- * @param Tag $tag
- */
public function addTag(Tag $tag)
{
if ($this->tags->contains($tag)) {
/**
* Remove the given tag from the entry (if the tag is associated).
- *
- * @param Tag $tag
*/
public function removeTag(Tag $tag)
{
}
/**
- * @param \Datetime $publishedAt
- *
* @return Entry
*/
public function setPublishedAt(\Datetime $publishedAt)
return $this->originUrl;
}
+ /**
+ * Set given url.
+ *
+ * @param string $givenUrl
+ *
+ * @return Entry
+ */
+ public function setGivenUrl($givenUrl)
+ {
+ $this->givenUrl = $givenUrl;
+ $this->hashedGivenUrl = UrlHasher::hashUrl($givenUrl);
+
+ return $this;
+ }
+
+ /**
+ * Get given url.
+ *
+ * @return string
+ */
+ public function getGivenUrl()
+ {
+ return $this->givenUrl;
+ }
+
/**
* @return string
*/