src/Entity/Content/Parts/TextBlock.php line 25
<?php
namespace App\Entity\Content\Parts;
use App\Entity\Common\Owner;
use App\Entity\Traits\ActiveTrait;
use App\Entity\Traits\TrackerFields;
use App\Entity\Traits\UserCreatedInterface;
use App\Entity\Traits\UserUpdatedInterface;
use App\Entity\Traits\WeightTrait;
use App\Model\Translation\TranslatableTrait;
use Doctrine\ORM\Mapping as ORM;
use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @method getCaption()
*/
#[ORM\Table(name: 'content_textblock')]
#[ORM\Index(name: 'idx_owner', columns: ['owner_uuid', 'deleted', 'active'])]
#[ORM\Index(name: 'idx_show', columns: ['slug', 'owner_uuid', 'deleted', 'active'])]
#[ORM\Entity(repositoryClass: \App\Repository\Content\Parts\TextBlockRepository::class)]
#[ORM\HasLifecycleCallbacks]
class TextBlock implements UserCreatedInterface, UserUpdatedInterface, TranslatableInterface
{
use TranslatableTrait;
use TrackerFields;
use ActiveTrait;
use WeightTrait;
/**
* @var int|null
*/
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
#[ORM\Column(type: 'integer')]
private $id;
/**
* @var string|null
*/
#[ORM\Column(type: 'string', length: 100)]
#[Assert\NotBlank]
private $slug;
/**
* @var string|null
*
*/
#[ORM\Column(type: 'string', nullable: true)]
private $caption;
/**
* @var string|null
*/
#[ORM\Column(type: 'text', nullable: true)]
private $content;
/**
* @var bool
*/
#[ORM\Column(type: 'boolean', options: ['default' => 1])]
private bool $showCaption=true;
/**
* @var bool
*/
#[ORM\Column(type: 'boolean', options: ['default' => 0])]
private bool $mainMenu=false;
/**
* @var Owner
*/
#[ORM\Embedded(class: 'App\Entity\Common\Owner')]
private Owner $owner;
public function __construct()
{
$this->owner = new Owner();
}
/**
* @return int|null
*/
public function getId(): ?int
{
return $this->id;
}
/**
* @param int|null $id
*/
public function setId(?int $id): void
{
$this->id = $id;
}
/**
* @return string|null
*/
public function getSlug(): ?string
{
return $this->slug;
}
/**
* @param string|null $slug
*/
public function setSlug(?string $slug): void
{
$this->slug = $slug;
}
/**
* @return Owner
*/
public function getOwner(): Owner
{
return $this->owner;
}
/**
* @param Owner $owner
*/
public function setOwner(Owner $owner): void
{
$this->owner = $owner;
}
/**
* @return bool
*/
public function isMainMenu(): bool
{
return $this->mainMenu;
}
/**
* @param bool $mainMenu
*/
public function setMainMenu(bool $mainMenu): void
{
$this->mainMenu = $mainMenu;
}
/**
* @return bool
*/
public function isShowCaption(): bool
{
return $this->showCaption;
}
/**
* @param bool $showCaption
*/
public function setShowCaption(bool $showCaption): void
{
$this->showCaption = $showCaption;
}
}