src/Entity/Content/Parts/TextBlockTranslation.php line 12
<?php
namespace App\Entity\Content\Parts;
use Doctrine\ORM\Mapping as ORM;
use Knp\DoctrineBehaviors\Contract\Entity\TranslationInterface;
use Knp\DoctrineBehaviors\Model\Translatable\TranslationTrait;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Table(name: 'content_textblock_translation')]
#[ORM\Entity]
class TextBlockTranslation implements TranslationInterface
{
use TranslationTrait {
isEmpty as ttEmpty;
}
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private ?int $id;
/**
* @var string|null
*/
#[ORM\Column(type: 'string')]
#[Assert\NotBlank]
private ?string $caption = null;
/**
* @var string|null
*/
#[ORM\Column(type: 'text', nullable: true)]
private ?string $content = null;
public function isEmpty(): bool
{
$parentResult = $this->ttEmpty();
if ($parentResult) {
return true;
}
if (empty($this->caption)) {
return true;
}
return false;
}
/**
* @return string|null
*/
public function getCaption(): ?string
{
return $this->caption;
}
/**
* @param string|null $caption
*/
public function setCaption(?string $caption): void
{
$this->caption = $caption;
}
/**
* @return string|null
*/
public function getContent(): ?string
{
return $this->content;
}
/**
* @param string|null $content
*/
public function setContent(?string $content): void
{
$this->content = $content;
}
/**
* @return int|null
*/
public function getId(): ?int
{
return $this->id;
}
/**
* @param int|null $id
*/
public function setId(?int $id): void
{
$this->id = $id;
}
}