<?php
declare(strict_types=1);
namespace Croisiland\CommonBundle\Entity\Itinerary;
use Crea\MediaBundle\Entity\MediaTagOwnerInterface;
use Crea\ToolsBundle\Entity\LifecycleUserIdentifierTrait;
use Croisiland\CommonBundle\Entity\Traits\IsActiveTrait;
use Croisiland\CommonBundle\Entity\Traits\ListOrderTrait;
use Croisiland\CommonBundle\Entity\Traits\ModuleOrderTrait;
use Doctrine\Common\Util\ClassUtils;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\MappedSuperclass;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @MappedSuperclass
*
* @UniqueEntity(
* fields={"slug"},
* errorPath="slug",
* message="destination.slug.unique_constraint",
* ignoreNull=true
* )
*/
class Destination implements \Stringable, MediaTagOwnerInterface
{
use ListOrderTrait;
use ModuleOrderTrait;
use IsActiveTrait;
use LifecycleUserIdentifierTrait;
/**
* @ORM\Id
*
* @ORM\GeneratedValue
*
* @ORM\Column(type="integer")
*/
private ?int $id = null;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private ?string $name = null;
/**
* @Gedmo\Slug(fields={"name"}, updatable=false)
*
* @ORM\Column(type="string", length=255, nullable=true, unique=true)
*/
private ?string $slug = null;
/**
* @ORM\Column(type="text", nullable=true)
*/
private ?string $shortDescription = null;
/**
* @ORM\Column(type="text", nullable=true)
*/
private ?string $description = null;
/**
* Destination fluviale
* @ORM\Column(type="boolean", nullable=true)
*/
private ?bool $riverside = null;
public function __construct()
{
}
public function __toString(): string
{
return $this->getName();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getShortDescription(): ?string
{
return $this->shortDescription;
}
public function setShortDescription(?string $shortDescription): self
{
$this->shortDescription = $shortDescription;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getRiverside(): ?bool
{
return $this->riverside;
}
public function setRiverside(?bool $riverside): Destination
{
$this->riverside = $riverside;
return $this;
}
public function isRiverside(): ?bool
{
return $this->riverside;
}
/**
* Method liée au Média Bundle
*/
public function getMediaTagOwnerLabel(): ?string
{
return $this->getName();
}
/**
* Method liée au Média Bundle
* @return class-string
*/
public function getFqcn(): string
{
return ClassUtils::getClass($this);
}
}