2015-01-22 17:18:56 +01:00
|
|
|
<?php
|
|
|
|
|
2024-02-19 01:30:12 +01:00
|
|
|
namespace Wallabag\Entity;
|
2015-01-22 17:18:56 +01:00
|
|
|
|
2015-02-20 20:29:33 +01:00
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
2015-01-22 17:18:56 +01:00
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
2015-02-20 11:45:38 +01:00
|
|
|
use Hateoas\Configuration\Annotation as Hateoas;
|
2016-03-13 20:17:52 +01:00
|
|
|
use JMS\Serializer\Annotation\Exclude;
|
2017-07-01 09:52:38 +02:00
|
|
|
use JMS\Serializer\Annotation\Groups;
|
2016-03-13 20:17:52 +01:00
|
|
|
use JMS\Serializer\Annotation\SerializedName;
|
2017-07-01 09:52:38 +02:00
|
|
|
use JMS\Serializer\Annotation\VirtualProperty;
|
|
|
|
use JMS\Serializer\Annotation\XmlRoot;
|
2015-12-22 10:16:34 +01:00
|
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
2024-02-19 01:30:12 +01:00
|
|
|
use Wallabag\Helper\EntityTimestampsTrait;
|
|
|
|
use Wallabag\Helper\UrlHasher;
|
2025-04-05 12:55:51 +02:00
|
|
|
use Wallabag\Repository\EntryRepository;
|
2015-01-22 17:18:56 +01:00
|
|
|
|
|
|
|
/**
|
2015-05-30 13:52:26 +02:00
|
|
|
* Entry.
|
2015-01-22 17:18:56 +01:00
|
|
|
*
|
2015-02-20 11:45:38 +01:00
|
|
|
* @XmlRoot("entry")
|
|
|
|
* @Hateoas\Relation("self", href = "expr('/api/entries/' ~ object.getId())")
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Table(name: '`entry`')]
|
|
|
|
#[ORM\Index(columns: ['created_at'])]
|
|
|
|
#[ORM\Index(columns: ['uid'])]
|
|
|
|
#[ORM\Index(columns: ['user_id', 'hashed_url'])]
|
|
|
|
#[ORM\Index(columns: ['user_id', 'hashed_given_url'])]
|
|
|
|
#[ORM\Index(columns: ['language', 'user_id'])]
|
|
|
|
#[ORM\Index(columns: ['user_id', 'is_archived', 'archived_at'])]
|
|
|
|
#[ORM\Index(columns: ['user_id', 'created_at'])]
|
|
|
|
#[ORM\Index(columns: ['user_id', 'is_starred', 'starred_at'])]
|
|
|
|
#[ORM\Entity(repositoryClass: EntryRepository::class)]
|
|
|
|
#[ORM\HasLifecycleCallbacks]
|
2015-02-06 07:45:32 +01:00
|
|
|
class Entry
|
2015-01-22 17:18:56 +01:00
|
|
|
{
|
2017-07-06 09:00:37 +02:00
|
|
|
use EntityTimestampsTrait;
|
|
|
|
|
2015-02-20 11:45:38 +01:00
|
|
|
/** @Serializer\XmlAttribute */
|
2015-01-22 17:18:56 +01:00
|
|
|
/**
|
2015-05-30 13:52:26 +02:00
|
|
|
* @var int
|
2015-01-22 17:18:56 +01:00
|
|
|
*
|
2015-10-19 20:31:30 +02:00
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'id', type: 'integer')]
|
|
|
|
#[ORM\Id]
|
|
|
|
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
2015-02-06 07:45:32 +01:00
|
|
|
private $id;
|
2015-01-22 17:18:56 +01:00
|
|
|
|
2016-04-10 17:33:15 +02:00
|
|
|
/**
|
2023-08-08 02:27:21 +01:00
|
|
|
* @var string|null
|
2016-04-10 17:33:15 +02:00
|
|
|
*
|
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'uid', type: 'string', length: 23, nullable: true)]
|
2016-12-29 10:09:44 +01:00
|
|
|
private $uid;
|
2016-04-10 17:33:15 +02:00
|
|
|
|
2015-01-22 17:18:56 +01:00
|
|
|
/**
|
2023-11-16 09:36:47 +01:00
|
|
|
* @var string|null
|
2015-01-22 17:18:56 +01:00
|
|
|
*
|
2015-10-19 20:31:30 +02:00
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'title', type: 'text', nullable: true)]
|
2015-01-22 17:18:56 +01:00
|
|
|
private $title;
|
|
|
|
|
|
|
|
/**
|
2019-05-29 14:18:04 +02:00
|
|
|
* Define the url fetched by wallabag (the final url after potential redirections).
|
|
|
|
*
|
2023-11-16 09:36:47 +01:00
|
|
|
* @var string|null
|
2015-01-22 17:18:56 +01:00
|
|
|
*
|
2015-10-19 20:31:30 +02:00
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'url', type: 'text', nullable: true)]
|
2025-04-05 15:06:57 +02:00
|
|
|
#[Assert\NotBlank]
|
|
|
|
#[Assert\Url(message: "The url '{{ value }}' is not a valid url")]
|
2015-01-22 17:18:56 +01:00
|
|
|
private $url;
|
|
|
|
|
2017-05-28 14:53:04 +02:00
|
|
|
/**
|
2023-11-16 09:36:47 +01:00
|
|
|
* @var string|null
|
2017-05-28 14:53:04 +02:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'hashed_url', type: 'string', length: 40, nullable: true)]
|
2017-05-28 14:53:04 +02:00
|
|
|
private $hashedUrl;
|
|
|
|
|
2019-05-29 14:18:04 +02:00
|
|
|
/**
|
|
|
|
* From where user retrieved/found the url (an other article, a twitter, or the given_url if non are provided).
|
|
|
|
*
|
2023-11-16 09:36:47 +01:00
|
|
|
* @var string|null
|
2019-05-29 14:18:04 +02:00
|
|
|
*
|
2015-10-19 20:31:30 +02:00
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'origin_url', type: 'text', nullable: true)]
|
2019-05-29 14:18:04 +02:00
|
|
|
private $originUrl;
|
2015-01-22 17:18:56 +01:00
|
|
|
|
2017-05-28 14:53:04 +02:00
|
|
|
/**
|
2019-05-29 14:18:04 +02:00
|
|
|
* Define the url entered by the user (without redirections).
|
|
|
|
*
|
2023-11-16 09:36:47 +01:00
|
|
|
* @var string|null
|
2017-05-28 14:53:04 +02:00
|
|
|
*
|
2019-05-29 14:18:04 +02:00
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
2017-05-28 14:53:04 +02:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'given_url', type: 'text', nullable: true)]
|
2019-05-29 14:18:04 +02:00
|
|
|
private $givenUrl;
|
|
|
|
|
|
|
|
/**
|
2023-11-16 09:36:47 +01:00
|
|
|
* @var string|null
|
2019-05-29 14:18:04 +02:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'hashed_given_url', type: 'string', length: 40, nullable: true)]
|
2019-05-29 14:18:04 +02:00
|
|
|
private $hashedGivenUrl;
|
2017-05-28 14:53:04 +02:00
|
|
|
|
2015-01-22 17:18:56 +01:00
|
|
|
/**
|
2015-05-30 13:52:26 +02:00
|
|
|
* @var bool
|
2015-01-22 17:18:56 +01:00
|
|
|
*
|
2016-03-16 20:41:29 +01:00
|
|
|
* @Exclude
|
|
|
|
*
|
2015-10-19 20:31:30 +02:00
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'is_archived', type: 'boolean')]
|
2015-02-05 22:33:36 +01:00
|
|
|
private $isArchived = false;
|
2015-01-22 17:18:56 +01:00
|
|
|
|
2018-04-11 11:42:52 +02:00
|
|
|
/**
|
2023-11-16 09:36:47 +01:00
|
|
|
* @var \DateTimeInterface|null
|
2018-04-11 11:42:52 +02:00
|
|
|
*
|
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'archived_at', type: 'datetime', nullable: true)]
|
2024-01-01 19:11:01 +01:00
|
|
|
private $archivedAt;
|
2018-04-11 11:42:52 +02:00
|
|
|
|
2015-01-22 17:18:56 +01:00
|
|
|
/**
|
2015-05-30 13:52:26 +02:00
|
|
|
* @var bool
|
2015-01-22 17:18:56 +01:00
|
|
|
*
|
2016-03-16 20:41:29 +01:00
|
|
|
* @Exclude
|
|
|
|
*
|
2015-10-19 20:31:30 +02:00
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'is_starred', type: 'boolean')]
|
2015-02-05 22:33:36 +01:00
|
|
|
private $isStarred = false;
|
2015-01-22 17:18:56 +01:00
|
|
|
|
|
|
|
/**
|
2023-11-16 09:36:47 +01:00
|
|
|
* @var string|null
|
2015-01-22 17:18:56 +01:00
|
|
|
*
|
2015-10-19 20:31:30 +02:00
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'content', type: 'text', nullable: true)]
|
2015-02-04 18:21:45 +01:00
|
|
|
private $content;
|
2015-01-22 17:18:56 +01:00
|
|
|
|
2015-02-04 22:25:44 +01:00
|
|
|
/**
|
2023-08-08 02:27:21 +01:00
|
|
|
* @var \DateTimeInterface
|
2015-02-04 22:25:44 +01:00
|
|
|
*
|
2016-09-08 16:38:08 +02:00
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
2015-02-04 22:25:44 +01:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'created_at', type: 'datetime')]
|
2015-02-04 22:25:44 +01:00
|
|
|
private $createdAt;
|
|
|
|
|
|
|
|
/**
|
2023-08-08 02:27:21 +01:00
|
|
|
* @var \DateTimeInterface
|
2015-02-04 22:25:44 +01:00
|
|
|
*
|
2016-09-08 16:38:08 +02:00
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
2015-02-04 22:25:44 +01:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'updated_at', type: 'datetime')]
|
2015-02-04 22:25:44 +01:00
|
|
|
private $updatedAt;
|
|
|
|
|
2017-04-05 22:22:16 +02:00
|
|
|
/**
|
2023-11-16 09:36:47 +01:00
|
|
|
* @var \DateTimeInterface|null
|
2017-04-05 22:22:16 +02:00
|
|
|
*
|
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'published_at', type: 'datetime', nullable: true)]
|
2017-04-05 22:22:16 +02:00
|
|
|
private $publishedAt;
|
|
|
|
|
2017-04-06 09:36:20 +02:00
|
|
|
/**
|
2023-11-16 09:36:47 +01:00
|
|
|
* @var array|null
|
2017-04-06 09:36:20 +02:00
|
|
|
*
|
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'published_by', type: 'array', nullable: true)]
|
2017-04-06 09:36:20 +02:00
|
|
|
private $publishedBy;
|
|
|
|
|
2017-08-23 23:06:40 +02:00
|
|
|
/**
|
2023-11-16 09:36:47 +01:00
|
|
|
* @var \DateTimeInterface|null
|
2017-08-23 23:06:40 +02:00
|
|
|
*
|
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'starred_at', type: 'datetime', nullable: true)]
|
2024-01-01 19:11:01 +01:00
|
|
|
private $starredAt;
|
2017-08-23 23:06:40 +02:00
|
|
|
|
2015-02-04 22:25:44 +01:00
|
|
|
/**
|
2016-02-07 16:52:59 +01:00
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
2015-02-04 22:25:44 +01:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\JoinTable]
|
|
|
|
#[ORM\OneToMany(targetEntity: Annotation::class, mappedBy: 'entry', cascade: ['persist', 'remove'])]
|
2016-02-26 13:59:08 +01:00
|
|
|
private $annotations;
|
2015-02-04 22:25:44 +01:00
|
|
|
|
|
|
|
/**
|
2023-11-16 09:36:47 +01:00
|
|
|
* @var string|null
|
2015-02-04 22:25:44 +01:00
|
|
|
*
|
2015-10-19 20:31:30 +02:00
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
2015-02-04 22:25:44 +01:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'mimetype', type: 'text', nullable: true)]
|
2015-02-04 22:25:44 +01:00
|
|
|
private $mimetype;
|
|
|
|
|
2015-09-20 22:37:27 +02:00
|
|
|
/**
|
2023-11-16 09:36:47 +01:00
|
|
|
* @var string|null
|
2015-09-20 22:37:27 +02:00
|
|
|
*
|
2015-10-19 20:31:30 +02:00
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
2015-09-20 22:37:27 +02:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'language', type: 'string', length: 20, nullable: true)]
|
2015-09-20 22:37:27 +02:00
|
|
|
private $language;
|
|
|
|
|
2015-02-04 22:25:44 +01:00
|
|
|
/**
|
2015-05-30 13:52:26 +02:00
|
|
|
* @var int
|
2015-02-04 22:25:44 +01:00
|
|
|
*
|
2015-10-19 20:31:30 +02:00
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
2015-02-04 22:25:44 +01:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'reading_time', type: 'integer', nullable: false)]
|
2017-10-08 22:08:18 +02:00
|
|
|
private $readingTime = 0;
|
2015-02-04 22:25:44 +01:00
|
|
|
|
|
|
|
/**
|
2023-11-16 09:36:47 +01:00
|
|
|
* @var string|null
|
2015-02-04 22:25:44 +01:00
|
|
|
*
|
2015-10-19 20:31:30 +02:00
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
2015-02-04 22:25:44 +01:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'domain_name', type: 'text', nullable: true)]
|
2015-02-04 22:25:44 +01:00
|
|
|
private $domainName;
|
|
|
|
|
2015-08-24 12:27:17 +02:00
|
|
|
/**
|
2023-11-16 09:36:47 +01:00
|
|
|
* @var string|null
|
2015-08-24 12:27:17 +02:00
|
|
|
*
|
2015-10-19 20:31:30 +02:00
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
2015-08-24 12:27:17 +02:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'preview_picture', type: 'text', nullable: true)]
|
2015-08-24 12:27:17 +02:00
|
|
|
private $previewPicture;
|
|
|
|
|
2016-11-18 15:09:21 +01:00
|
|
|
/**
|
2023-11-16 09:36:47 +01:00
|
|
|
* @var string|null
|
2016-11-18 15:09:21 +01:00
|
|
|
*
|
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'http_status', type: 'string', length: 3, nullable: true)]
|
2016-11-18 15:09:21 +01:00
|
|
|
private $httpStatus;
|
|
|
|
|
2017-05-11 14:18:21 +02:00
|
|
|
/**
|
2023-11-16 09:36:47 +01:00
|
|
|
* @var array|null
|
2017-05-11 14:18:21 +02:00
|
|
|
*
|
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'headers', type: 'array', nullable: true)]
|
2017-05-11 14:18:21 +02:00
|
|
|
private $headers;
|
|
|
|
|
2023-07-28 14:58:43 +02:00
|
|
|
/**
|
|
|
|
* @var bool
|
|
|
|
*
|
|
|
|
* @Exclude
|
|
|
|
*
|
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\Column(name: 'is_not_parsed', type: 'boolean', options: ['default' => false])]
|
2023-07-28 14:58:43 +02:00
|
|
|
private $isNotParsed = false;
|
|
|
|
|
2015-02-06 15:18:54 +01:00
|
|
|
/**
|
2016-03-13 20:17:52 +01:00
|
|
|
* @Exclude
|
|
|
|
*
|
2015-10-19 20:31:30 +02:00
|
|
|
* @Groups({"export_all"})
|
2015-02-06 15:18:54 +01:00
|
|
|
*/
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'entries')]
|
2015-02-06 15:18:54 +01:00
|
|
|
private $user;
|
|
|
|
|
2025-04-05 12:55:51 +02:00
|
|
|
#[ORM\JoinTable(name: 'entry_tag')]
|
|
|
|
#[ORM\JoinColumn(name: 'entry_id', referencedColumnName: 'id', onDelete: 'cascade')]
|
|
|
|
#[ORM\InverseJoinColumn(name: 'tag_id', referencedColumnName: 'id', onDelete: 'cascade')]
|
|
|
|
#[ORM\ManyToMany(targetEntity: Tag::class, inversedBy: 'entries', cascade: ['persist'])]
|
2015-02-20 20:29:33 +01:00
|
|
|
private $tags;
|
|
|
|
|
2015-02-06 15:18:54 +01:00
|
|
|
/*
|
|
|
|
* @param User $user
|
|
|
|
*/
|
2016-03-27 19:20:43 +02:00
|
|
|
public function __construct(User $user)
|
2015-02-06 15:18:54 +01:00
|
|
|
{
|
|
|
|
$this->user = $user;
|
2015-02-20 20:29:33 +01:00
|
|
|
$this->tags = new ArrayCollection();
|
2015-02-06 15:18:54 +01:00
|
|
|
}
|
|
|
|
|
2015-01-22 17:18:56 +01:00
|
|
|
/**
|
2015-05-30 13:52:26 +02:00
|
|
|
* Get id.
|
2015-01-22 17:18:56 +01:00
|
|
|
*
|
2015-05-30 13:52:26 +02:00
|
|
|
* @return int
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
|
|
|
public function getId()
|
|
|
|
{
|
|
|
|
return $this->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-05-30 13:52:26 +02:00
|
|
|
* Set title.
|
|
|
|
*
|
|
|
|
* @param string $title
|
2015-01-22 17:18:56 +01:00
|
|
|
*
|
2015-02-06 07:45:32 +01:00
|
|
|
* @return Entry
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
|
|
|
public function setTitle($title)
|
|
|
|
{
|
|
|
|
$this->title = $title;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-05-30 13:52:26 +02:00
|
|
|
* Get title.
|
2015-01-22 17:18:56 +01:00
|
|
|
*
|
2015-01-31 19:09:34 +01:00
|
|
|
* @return string
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
|
|
|
public function getTitle()
|
|
|
|
{
|
|
|
|
return $this->title;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-05-30 13:52:26 +02:00
|
|
|
* Set url.
|
|
|
|
*
|
|
|
|
* @param string $url
|
2015-01-22 17:18:56 +01:00
|
|
|
*
|
2015-02-06 07:45:32 +01:00
|
|
|
* @return Entry
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
|
|
|
public function setUrl($url)
|
|
|
|
{
|
|
|
|
$this->url = $url;
|
2019-05-10 22:07:55 +10:00
|
|
|
$this->hashedUrl = UrlHasher::hashUrl($url);
|
2015-01-22 17:18:56 +01:00
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-05-30 13:52:26 +02:00
|
|
|
* Get url.
|
2015-01-22 17:18:56 +01:00
|
|
|
*
|
2015-01-31 19:09:34 +01:00
|
|
|
* @return string
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
|
|
|
public function getUrl()
|
|
|
|
{
|
|
|
|
return $this->url;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-05-30 13:52:26 +02:00
|
|
|
* Set isArchived.
|
|
|
|
*
|
2016-01-03 10:59:55 +01:00
|
|
|
* @param bool $isArchived
|
2015-01-22 17:18:56 +01:00
|
|
|
*
|
2015-02-06 07:45:32 +01:00
|
|
|
* @return Entry
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
2015-02-05 22:33:36 +01:00
|
|
|
public function setArchived($isArchived)
|
2015-01-22 17:18:56 +01:00
|
|
|
{
|
2015-02-05 22:33:36 +01:00
|
|
|
$this->isArchived = $isArchived;
|
2015-01-22 17:18:56 +01:00
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2018-04-11 11:42:52 +02:00
|
|
|
/**
|
|
|
|
* update isArchived and archive_at fields.
|
|
|
|
*
|
|
|
|
* @param bool $isArchived
|
|
|
|
*
|
|
|
|
* @return Entry
|
|
|
|
*/
|
|
|
|
public function updateArchived($isArchived = false)
|
|
|
|
{
|
|
|
|
$this->setArchived($isArchived);
|
|
|
|
$this->setArchivedAt(null);
|
|
|
|
if ($this->isArchived()) {
|
|
|
|
$this->setArchivedAt(new \DateTime());
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-08-08 02:27:21 +01:00
|
|
|
* @return \DateTimeInterface|null
|
2018-04-11 11:42:52 +02:00
|
|
|
*/
|
|
|
|
public function getArchivedAt()
|
|
|
|
{
|
|
|
|
return $this->archivedAt;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-08-08 02:27:21 +01:00
|
|
|
* @param \DateTimeInterface|null $archivedAt
|
2018-04-11 11:42:52 +02:00
|
|
|
*
|
|
|
|
* @return Entry
|
|
|
|
*/
|
|
|
|
public function setArchivedAt($archivedAt = null)
|
|
|
|
{
|
|
|
|
$this->archivedAt = $archivedAt;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2015-01-22 17:18:56 +01:00
|
|
|
/**
|
2015-05-30 13:52:26 +02:00
|
|
|
* Get isArchived.
|
2015-01-22 17:18:56 +01:00
|
|
|
*
|
2016-01-03 10:59:55 +01:00
|
|
|
* @return bool
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
2015-02-05 22:33:36 +01:00
|
|
|
public function isArchived()
|
2015-01-22 17:18:56 +01:00
|
|
|
{
|
2015-02-05 22:33:36 +01:00
|
|
|
return $this->isArchived;
|
2015-01-22 17:18:56 +01:00
|
|
|
}
|
|
|
|
|
2016-03-16 20:41:29 +01:00
|
|
|
/**
|
|
|
|
* @VirtualProperty
|
|
|
|
* @SerializedName("is_archived")
|
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
|
|
|
*/
|
|
|
|
public function is_Archived()
|
|
|
|
{
|
|
|
|
return (int) $this->isArchived();
|
|
|
|
}
|
|
|
|
|
2015-01-23 12:45:24 +01:00
|
|
|
public function toggleArchive()
|
|
|
|
{
|
2018-04-11 11:42:52 +02:00
|
|
|
$this->updateArchived($this->isArchived() ^ 1);
|
2015-01-31 19:09:34 +01:00
|
|
|
|
2015-01-23 12:45:24 +01:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2015-01-22 17:18:56 +01:00
|
|
|
/**
|
2015-05-30 13:52:26 +02:00
|
|
|
* Set isStarred.
|
|
|
|
*
|
2016-01-03 10:59:55 +01:00
|
|
|
* @param bool $isStarred
|
2015-01-22 17:18:56 +01:00
|
|
|
*
|
2015-02-06 07:45:32 +01:00
|
|
|
* @return Entry
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
2015-02-05 22:33:36 +01:00
|
|
|
public function setStarred($isStarred)
|
2015-01-22 17:18:56 +01:00
|
|
|
{
|
2015-02-05 22:33:36 +01:00
|
|
|
$this->isStarred = $isStarred;
|
2015-01-22 17:18:56 +01:00
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-05-30 13:52:26 +02:00
|
|
|
* Get isStarred.
|
2015-01-22 17:18:56 +01:00
|
|
|
*
|
2016-01-03 10:59:55 +01:00
|
|
|
* @return bool
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
2015-02-05 22:33:36 +01:00
|
|
|
public function isStarred()
|
2015-01-22 17:18:56 +01:00
|
|
|
{
|
2015-02-05 22:33:36 +01:00
|
|
|
return $this->isStarred;
|
2015-01-22 17:18:56 +01:00
|
|
|
}
|
|
|
|
|
2016-03-16 20:41:29 +01:00
|
|
|
/**
|
|
|
|
* @VirtualProperty
|
|
|
|
* @SerializedName("is_starred")
|
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
|
|
|
*/
|
|
|
|
public function is_Starred()
|
|
|
|
{
|
|
|
|
return (int) $this->isStarred();
|
|
|
|
}
|
|
|
|
|
2015-01-23 12:45:24 +01:00
|
|
|
public function toggleStar()
|
|
|
|
{
|
2023-08-08 02:27:21 +01:00
|
|
|
$this->isStarred = !$this->isStarred();
|
2015-01-23 12:45:24 +01:00
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2015-01-22 17:18:56 +01:00
|
|
|
/**
|
2015-05-30 13:52:26 +02:00
|
|
|
* Set content.
|
|
|
|
*
|
|
|
|
* @param string $content
|
2015-01-22 17:18:56 +01:00
|
|
|
*
|
2015-02-06 07:45:32 +01:00
|
|
|
* @return Entry
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
|
|
|
public function setContent($content)
|
|
|
|
{
|
|
|
|
$this->content = $content;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-05-30 13:52:26 +02:00
|
|
|
* Get content.
|
2015-01-22 17:18:56 +01:00
|
|
|
*
|
2015-01-31 19:09:34 +01:00
|
|
|
* @return string
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
|
|
|
public function getContent()
|
|
|
|
{
|
|
|
|
return $this->content;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-02-06 15:18:54 +01:00
|
|
|
* @return User
|
2015-01-22 17:18:56 +01:00
|
|
|
*/
|
2015-02-06 15:18:54 +01:00
|
|
|
public function getUser()
|
2015-01-22 17:18:56 +01:00
|
|
|
{
|
2015-02-06 15:18:54 +01:00
|
|
|
return $this->user;
|
2015-01-22 17:18:56 +01:00
|
|
|
}
|
2015-02-04 17:54:23 +01:00
|
|
|
|
2016-03-13 20:17:52 +01:00
|
|
|
/**
|
|
|
|
* @VirtualProperty
|
|
|
|
* @SerializedName("user_name")
|
|
|
|
*/
|
|
|
|
public function getUserName()
|
|
|
|
{
|
|
|
|
return $this->user->getUserName();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @VirtualProperty
|
|
|
|
* @SerializedName("user_email")
|
|
|
|
*/
|
|
|
|
public function getUserEmail()
|
|
|
|
{
|
|
|
|
return $this->user->getEmail();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @VirtualProperty
|
|
|
|
* @SerializedName("user_id")
|
|
|
|
*/
|
|
|
|
public function getUserId()
|
|
|
|
{
|
|
|
|
return $this->user->getId();
|
|
|
|
}
|
|
|
|
|
2015-02-04 22:25:44 +01:00
|
|
|
/**
|
2016-09-09 09:36:07 +02:00
|
|
|
* Set created_at.
|
|
|
|
* Only used when importing data from an other service.
|
|
|
|
*
|
|
|
|
* @return Entry
|
|
|
|
*/
|
2020-03-21 21:11:01 +01:00
|
|
|
public function setCreatedAt(\DateTimeInterface $createdAt)
|
2016-09-09 09:36:07 +02:00
|
|
|
{
|
|
|
|
$this->createdAt = $createdAt;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-08-08 02:27:21 +01:00
|
|
|
* @return \DateTimeInterface
|
2015-02-04 22:25:44 +01:00
|
|
|
*/
|
|
|
|
public function getCreatedAt()
|
|
|
|
{
|
|
|
|
return $this->createdAt;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-08-08 02:27:21 +01:00
|
|
|
* @return \DateTimeInterface
|
2015-02-04 22:25:44 +01:00
|
|
|
*/
|
|
|
|
public function getUpdatedAt()
|
|
|
|
{
|
|
|
|
return $this->updatedAt;
|
|
|
|
}
|
|
|
|
|
2017-08-23 23:06:40 +02:00
|
|
|
/**
|
2023-08-08 02:27:21 +01:00
|
|
|
* @return \DateTimeInterface|null
|
2017-08-23 23:06:40 +02:00
|
|
|
*/
|
|
|
|
public function getStarredAt()
|
|
|
|
{
|
|
|
|
return $this->starredAt;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-08-08 02:27:21 +01:00
|
|
|
* @param \DateTimeInterface|null $starredAt
|
2017-08-23 23:06:40 +02:00
|
|
|
*
|
|
|
|
* @return Entry
|
|
|
|
*/
|
|
|
|
public function setStarredAt($starredAt = null)
|
|
|
|
{
|
|
|
|
$this->starredAt = $starredAt;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* update isStarred and starred_at fields.
|
|
|
|
*
|
|
|
|
* @param bool $isStarred
|
|
|
|
*
|
|
|
|
* @return Entry
|
|
|
|
*/
|
|
|
|
public function updateStar($isStarred = false)
|
|
|
|
{
|
|
|
|
$this->setStarred($isStarred);
|
|
|
|
$this->setStarredAt(null);
|
|
|
|
if ($this->isStarred()) {
|
|
|
|
$this->setStarredAt(new \DateTime());
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2015-02-04 22:25:44 +01:00
|
|
|
/**
|
2016-02-26 13:59:08 +01:00
|
|
|
* @return ArrayCollection<Annotation>
|
2015-02-04 22:25:44 +01:00
|
|
|
*/
|
2016-02-26 13:59:08 +01:00
|
|
|
public function getAnnotations()
|
2015-02-04 22:25:44 +01:00
|
|
|
{
|
2016-02-26 13:59:08 +01:00
|
|
|
return $this->annotations;
|
2015-02-04 22:25:44 +01:00
|
|
|
}
|
|
|
|
|
2016-02-26 13:59:08 +01:00
|
|
|
public function setAnnotation(Annotation $annotation)
|
2015-02-04 22:25:44 +01:00
|
|
|
{
|
2016-02-26 13:59:08 +01:00
|
|
|
$this->annotations[] = $annotation;
|
2015-02-04 22:25:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getMimetype()
|
|
|
|
{
|
|
|
|
return $this->mimetype;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $mimetype
|
|
|
|
*/
|
|
|
|
public function setMimetype($mimetype)
|
|
|
|
{
|
|
|
|
$this->mimetype = $mimetype;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function getReadingTime()
|
|
|
|
{
|
|
|
|
return $this->readingTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param int $readingTime
|
|
|
|
*/
|
|
|
|
public function setReadingTime($readingTime)
|
|
|
|
{
|
|
|
|
$this->readingTime = $readingTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getDomainName()
|
|
|
|
{
|
|
|
|
return $this->domainName;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $domainName
|
|
|
|
*/
|
|
|
|
public function setDomainName($domainName)
|
|
|
|
{
|
|
|
|
$this->domainName = $domainName;
|
|
|
|
}
|
|
|
|
|
2015-02-20 20:29:33 +01:00
|
|
|
/**
|
2017-05-30 13:01:25 +02:00
|
|
|
* @return ArrayCollection
|
2015-02-20 20:29:33 +01:00
|
|
|
*/
|
|
|
|
public function getTags()
|
|
|
|
{
|
|
|
|
return $this->tags;
|
|
|
|
}
|
|
|
|
|
2022-01-31 09:27:20 +01:00
|
|
|
/**
|
|
|
|
* Only used during tests.
|
|
|
|
*/
|
|
|
|
public function getTagsLabel(): array
|
|
|
|
{
|
|
|
|
$tags = [];
|
|
|
|
foreach ($this->tags as $tag) {
|
|
|
|
$tags[] = $tag->getLabel();
|
|
|
|
}
|
|
|
|
|
|
|
|
return $tags;
|
|
|
|
}
|
|
|
|
|
2016-10-02 16:06:42 +02:00
|
|
|
/**
|
|
|
|
* @VirtualProperty
|
|
|
|
* @SerializedName("tags")
|
|
|
|
* @Groups({"entries_for_user", "export_all"})
|
|
|
|
*/
|
|
|
|
public function getSerializedTags()
|
|
|
|
{
|
|
|
|
$data = [];
|
|
|
|
foreach ($this->tags as $tag) {
|
|
|
|
$data[] = $tag->getLabel();
|
|
|
|
}
|
|
|
|
|
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
|
2015-02-20 20:29:33 +01:00
|
|
|
public function addTag(Tag $tag)
|
|
|
|
{
|
2015-10-24 15:11:06 +02:00
|
|
|
if ($this->tags->contains($tag)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-12-27 22:26:49 +01:00
|
|
|
// check if tag already exist but has not yet be persisted
|
|
|
|
// it seems that the previous condition with `contains()` doesn't check that case
|
|
|
|
foreach ($this->tags as $existingTag) {
|
2015-12-29 14:50:52 +01:00
|
|
|
if ($existingTag->getLabel() === $tag->getLabel()) {
|
2015-12-27 22:26:49 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-30 14:34:11 +02:00
|
|
|
$this->tags->add($tag);
|
2015-02-20 20:29:33 +01:00
|
|
|
}
|
2015-02-26 09:41:42 +01:00
|
|
|
|
2017-06-30 16:54:26 +02:00
|
|
|
/**
|
|
|
|
* Remove the given tag from the entry (if the tag is associated).
|
|
|
|
*/
|
2015-02-26 09:41:42 +01:00
|
|
|
public function removeTag(Tag $tag)
|
|
|
|
{
|
2016-05-30 14:34:11 +02:00
|
|
|
if (!$this->tags->contains($tag)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-02-26 09:41:42 +01:00
|
|
|
$this->tags->removeElement($tag);
|
2016-05-30 14:34:11 +02:00
|
|
|
$tag->removeEntry($this);
|
2015-02-26 09:41:42 +01:00
|
|
|
}
|
2015-08-24 12:27:17 +02:00
|
|
|
|
2017-06-30 16:54:26 +02:00
|
|
|
/**
|
|
|
|
* Remove all assigned tags from the entry.
|
|
|
|
*/
|
|
|
|
public function removeAllTags()
|
|
|
|
{
|
|
|
|
foreach ($this->tags as $tag) {
|
|
|
|
$this->tags->removeElement($tag);
|
|
|
|
$tag->removeEntry($this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-24 12:27:17 +02:00
|
|
|
/**
|
2015-08-24 12:35:02 +02:00
|
|
|
* Set previewPicture.
|
2015-08-24 12:27:17 +02:00
|
|
|
*
|
|
|
|
* @param string $previewPicture
|
|
|
|
*
|
|
|
|
* @return Entry
|
|
|
|
*/
|
|
|
|
public function setPreviewPicture($previewPicture)
|
|
|
|
{
|
|
|
|
$this->previewPicture = $previewPicture;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-08-24 12:35:02 +02:00
|
|
|
* Get previewPicture.
|
2015-08-24 12:27:17 +02:00
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getPreviewPicture()
|
|
|
|
{
|
|
|
|
return $this->previewPicture;
|
|
|
|
}
|
2015-09-20 22:37:27 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set language.
|
|
|
|
*
|
|
|
|
* @param string $language
|
|
|
|
*
|
|
|
|
* @return Entry
|
|
|
|
*/
|
|
|
|
public function setLanguage($language)
|
|
|
|
{
|
|
|
|
$this->language = $language;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get language.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getLanguage()
|
|
|
|
{
|
|
|
|
return $this->language;
|
|
|
|
}
|
2016-04-10 17:33:15 +02:00
|
|
|
|
2019-01-11 21:09:49 +01:00
|
|
|
/**
|
|
|
|
* Format the entry language to a valid html lang attribute.
|
|
|
|
*/
|
|
|
|
public function getHTMLLanguage()
|
|
|
|
{
|
|
|
|
$parsedLocale = \Locale::parseLocale($this->getLanguage());
|
|
|
|
$lang = '';
|
|
|
|
$lang .= $parsedLocale['language'] ?? '';
|
|
|
|
$lang .= isset($parsedLocale['region']) ? '-' . $parsedLocale['region'] : '';
|
|
|
|
|
|
|
|
return $lang;
|
|
|
|
}
|
|
|
|
|
2016-04-10 17:33:15 +02:00
|
|
|
/**
|
2019-05-29 12:00:23 +02:00
|
|
|
* @return string|null
|
2016-04-10 17:33:15 +02:00
|
|
|
*/
|
2016-12-29 10:09:44 +01:00
|
|
|
public function getUid()
|
2016-04-10 17:33:15 +02:00
|
|
|
{
|
2016-12-29 10:09:44 +01:00
|
|
|
return $this->uid;
|
2016-04-10 17:33:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-12-29 10:09:44 +01:00
|
|
|
* @param string $uid
|
2016-04-10 17:33:15 +02:00
|
|
|
*
|
|
|
|
* @return Entry
|
|
|
|
*/
|
2016-12-29 10:09:44 +01:00
|
|
|
public function setUid($uid)
|
2016-04-10 17:33:15 +02:00
|
|
|
{
|
2016-12-29 10:09:44 +01:00
|
|
|
$this->uid = $uid;
|
2016-04-10 17:33:15 +02:00
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2016-12-29 10:09:44 +01:00
|
|
|
public function generateUid()
|
2016-04-10 17:33:15 +02:00
|
|
|
{
|
2016-12-29 10:09:44 +01:00
|
|
|
if (null === $this->uid) {
|
2016-04-15 13:42:13 +02:00
|
|
|
// @see http://blog.kevingomez.fr/til/2015/07/26/why-is-uniqid-slow/ for true parameter
|
2016-12-29 10:09:44 +01:00
|
|
|
$this->uid = uniqid('', true);
|
2016-04-10 17:33:15 +02:00
|
|
|
}
|
|
|
|
}
|
2016-08-23 16:49:12 +02:00
|
|
|
|
2016-12-29 10:09:44 +01:00
|
|
|
public function cleanUid()
|
2016-08-23 16:49:12 +02:00
|
|
|
{
|
2016-12-29 10:09:44 +01:00
|
|
|
$this->uid = null;
|
2016-08-23 16:49:12 +02:00
|
|
|
}
|
2016-11-18 15:09:21 +01:00
|
|
|
|
2017-06-10 15:00:52 +02:00
|
|
|
/**
|
|
|
|
* Used in the entries filter so it's more explicit for the end user than the uid.
|
2017-06-10 15:37:25 +02:00
|
|
|
* Also used in the API.
|
2017-06-10 15:00:52 +02:00
|
|
|
*
|
2017-06-10 15:31:57 +02:00
|
|
|
* @VirtualProperty
|
|
|
|
* @SerializedName("is_public")
|
|
|
|
* @Groups({"entries_for_user"})
|
|
|
|
*
|
2017-06-10 15:00:52 +02:00
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function isPublic()
|
|
|
|
{
|
|
|
|
return null !== $this->uid;
|
|
|
|
}
|
|
|
|
|
2016-11-18 15:09:21 +01:00
|
|
|
/**
|
2017-05-30 11:39:15 +02:00
|
|
|
* @return string
|
2016-11-18 15:09:21 +01:00
|
|
|
*/
|
|
|
|
public function getHttpStatus()
|
|
|
|
{
|
|
|
|
return $this->httpStatus;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-05-30 11:39:15 +02:00
|
|
|
* @param string $httpStatus
|
2016-11-18 15:09:21 +01:00
|
|
|
*
|
|
|
|
* @return Entry
|
|
|
|
*/
|
|
|
|
public function setHttpStatus($httpStatus)
|
|
|
|
{
|
|
|
|
$this->httpStatus = $httpStatus;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
2017-04-05 22:22:16 +02:00
|
|
|
|
|
|
|
/**
|
2023-08-08 02:27:21 +01:00
|
|
|
* @return \DateTimeInterface
|
2017-04-05 22:22:16 +02:00
|
|
|
*/
|
|
|
|
public function getPublishedAt()
|
|
|
|
{
|
|
|
|
return $this->publishedAt;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return Entry
|
|
|
|
*/
|
2023-08-08 02:27:21 +01:00
|
|
|
public function setPublishedAt(\DateTimeInterface $publishedAt)
|
2017-04-05 22:22:16 +02:00
|
|
|
{
|
|
|
|
$this->publishedAt = $publishedAt;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
2017-04-06 09:36:20 +02:00
|
|
|
|
|
|
|
/**
|
2017-05-11 14:18:21 +02:00
|
|
|
* @return array
|
2017-04-06 09:36:20 +02:00
|
|
|
*/
|
|
|
|
public function getPublishedBy()
|
|
|
|
{
|
|
|
|
return $this->publishedBy;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-05-11 14:53:56 +02:00
|
|
|
* @param array $publishedBy
|
2017-04-06 09:36:20 +02:00
|
|
|
*
|
|
|
|
* @return Entry
|
|
|
|
*/
|
|
|
|
public function setPublishedBy($publishedBy)
|
|
|
|
{
|
|
|
|
$this->publishedBy = $publishedBy;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
2017-05-11 14:18:21 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function getHeaders()
|
|
|
|
{
|
|
|
|
return $this->headers;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-05-11 14:53:56 +02:00
|
|
|
* @param array $headers
|
2017-05-11 14:18:21 +02:00
|
|
|
*
|
|
|
|
* @return Entry
|
|
|
|
*/
|
|
|
|
public function setHeaders($headers)
|
|
|
|
{
|
|
|
|
$this->headers = $headers;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
2017-11-19 15:26:13 +01:00
|
|
|
|
2017-09-04 23:39:08 +02:00
|
|
|
/**
|
|
|
|
* Set origin url.
|
|
|
|
*
|
|
|
|
* @param string $originUrl
|
|
|
|
*
|
|
|
|
* @return Entry
|
|
|
|
*/
|
|
|
|
public function setOriginUrl($originUrl)
|
|
|
|
{
|
|
|
|
$this->originUrl = $originUrl;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
2017-11-19 15:26:13 +01:00
|
|
|
|
2017-09-04 23:39:08 +02:00
|
|
|
/**
|
|
|
|
* Get origin url.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getOriginUrl()
|
|
|
|
{
|
|
|
|
return $this->originUrl;
|
|
|
|
}
|
2017-05-28 14:53:04 +02:00
|
|
|
|
2019-05-29 14:18:04 +02:00
|
|
|
/**
|
2019-06-05 10:54:43 +02:00
|
|
|
* Set given url.
|
2019-05-29 14:18:04 +02:00
|
|
|
*
|
|
|
|
* @param string $givenUrl
|
|
|
|
*
|
|
|
|
* @return Entry
|
|
|
|
*/
|
|
|
|
public function setGivenUrl($givenUrl)
|
|
|
|
{
|
|
|
|
$this->givenUrl = $givenUrl;
|
|
|
|
$this->hashedGivenUrl = UrlHasher::hashUrl($givenUrl);
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2019-06-05 10:54:43 +02:00
|
|
|
* Get given url.
|
2019-05-29 14:18:04 +02:00
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getGivenUrl()
|
|
|
|
{
|
|
|
|
return $this->givenUrl;
|
|
|
|
}
|
|
|
|
|
2017-05-28 14:53:04 +02:00
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getHashedUrl()
|
|
|
|
{
|
|
|
|
return $this->hashedUrl;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return Entry
|
|
|
|
*/
|
|
|
|
public function setHashedUrl($hashedUrl)
|
|
|
|
{
|
|
|
|
$this->hashedUrl = $hashedUrl;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
2023-07-28 14:58:43 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set isNotParsed.
|
|
|
|
*
|
|
|
|
* @return Entry
|
|
|
|
*/
|
2024-03-10 17:30:29 +01:00
|
|
|
public function setNotParsed(bool $isNotParsed)
|
2023-07-28 14:58:43 +02:00
|
|
|
{
|
|
|
|
$this->isNotParsed = $isNotParsed;
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get isNotParsed.
|
|
|
|
*/
|
2024-03-10 17:30:29 +01:00
|
|
|
public function isNotParsed(): bool
|
2023-07-28 14:58:43 +02:00
|
|
|
{
|
|
|
|
return $this->isNotParsed;
|
|
|
|
}
|
2015-01-22 17:18:56 +01:00
|
|
|
}
|