<?phpnamespace App\Entity;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity * @ORM\Entity(repositoryClass="App\Repository\PageRepository") * @ORM\Table(indexes={@ORM\Index(name="url_idx", columns={"url"})}) */class Page implements EntityInterface{ const STATUS_DRAFT = "draft"; const STATUS_PUBLISHED = "published"; /** * @var int|null * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue */ private $id; /** * @var string * @ORM\Column(type="string") */ private $title; /** * @var string * @ORM\Column(type="text") */ private $content; /** * @var string * @ORM\Column(type="string") */ private $url; /** * @var string * @ORM\Column(name="status", type="string", options={"default" : Page::STATUS_DRAFT}) */ private $status = self::STATUS_DRAFT; /** * @var string * @ORM\Column(type="string", name="restricted_to") */ private $restrictedTo; public function __construct( string $title = '', string $content = '', string $url = '', string $status = '', string $restrictedTo = '' ) { $this->title = $title; $this->content = $content; $this->url = $url; $this->status = $status; $this->restrictedTo = $restrictedTo; } /** * @return string */ public function __toString(): string { return (string)$this->title . " (" . $this->id . ")"; } public function toString(): string { return "{id=" . $this->id . ",title=" . $this->title . "}"; } /** * @return int|null */ public function getId(): ?int { return $this->id; } /** * @return string */ public function getTitle(): ?string { return $this->title; } /** * @param string $title * * @return self */ public function setTitle(string $title): self { $this->title = $title; return $this; } /** * @return string */ public function getContent(): ?string { return $this->content; } /** * @param string $content * * @return self */ public function setContent(string $content): self { $this->content = $content; return $this; } /** * @return string */ public function getUrl() { return $this->url; } /** * @param string $url */ public function setUrl($url) { $this->url = $url; } /** * @return string */ public function getRestrictedTo(): ?string { return $this->restrictedTo; } /** * @param string $restrictedTo */ public function setRestrictedTo($restrictedTo) { $this->restrictedTo = $restrictedTo; } /** * @return string */ public function getStatus(): ?string { return $this->status; } /** * @param string $status */ public function setStatus($status) { $this->status = $status; }}