<?php
namespace Submarine\PagesBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Submarine\CoreBundle\Entity\SubmarineEntityInterface;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Class TitleUrlRelations
* @package Submarine\PagesBundle
*
* @ORM\Entity
* @ORM\Table(name="submarine_title_url_relations")
* @ORM\HasLifecycleCallbacks()
*/
class TitleUrlRelations implements SubmarineEntityInterface
{
/**
* ID
* @var int
*
* @ORM\Id()
* @ORM\Column(name="id", type="integer", nullable=false, unique=true)
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string|null
*
* @ORM\Column(name="title", type="string", nullable=true)
* @Assert\NotBlank()
*/
private $title;
/**
* URL
* @var string|null
*
* @ORM\Column(name="url", type="string", nullable=true)
*/
private $url;
/**
* Страница каталога
*
* @var Page
* @ORM\ManyToOne(targetEntity="Submarine\PagesBundle\Entity\Page", inversedBy="titleUrlRelations")
* @ORM\JoinColumn(name="page_id", referencedColumnName="id")
*/
private $page;
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @param int $id
*/
public function setId(int $id): void
{
$this->id = $id;
}
/**
* @return string|null
*/
public function getTitle(): ?string
{
return $this->title;
}
/**
* @param string|null $title
*/
public function setTitle(?string $title): void
{
$this->title = $title;
}
/**
* @return string|null
*/
public function getUrl(): ?string
{
return $this->url;
}
/**
* @param string|null $url
*/
public function setUrl(?string $url): void
{
$this->url = $url;
}
/**
* @return Page
*/
public function getPage()
{
return $this->page;
}
/**
* @param Page $page
*/
public function setPage(Page $page): void
{
$this->page = $page;
}
/**
* Имя сущности
* @return string
*/
public static function entityName(): string
{
return __CLASS__;
}
}