src/Entity/BannerTranslation.php line 18
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use ApiPlatform\Metadata\ApiResource,
ApiPlatform\Metadata\Get;
use App\Enum\Language,
App\Repository\BannerTranslationRepository;
#[ApiResource(
security: 'is_granted("' . Banner::class . '")',
operations: [ new Get() ],
extraProperties: ['standard_put' => false],
)]
#[ORM\Entity(repositoryClass: BannerTranslationRepository::class)]
class BannerTranslation extends AbstractBannerTranslation
{
public function __construct(Banner $parent, Language $lang)
{
parent::__construct($parent, $lang);
}
public function setTitle(?string $title): self
{
$this->title = $title;
/** @var Banner */
$parent = $this->parent;
if ($this->lang === $parent->getNativeLanguage()) {
$parent->setNativeTitle($title);
}
return $this;
}
}