src/Entity/SeoMainPage.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\IdTrait;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Repository\SeoMainPageRepository;
  6. /**
  7.  * @ORM\Entity(repositoryClass=SeoMainPageRepository::class)
  8.  */
  9. class SeoMainPage
  10. {
  11.     use IdTrait;
  12.     public function __construct(
  13.         /**
  14.          * @ORM\Column(type="text", nullable=true)
  15.          */
  16.         private ?string $seoRightBlockPl,
  17.         /**
  18.          * @ORM\Column(type="text", nullable=true)
  19.          */
  20.         private ?string $seoLeftBlockPl,
  21.         /**
  22.          * @ORM\Column(type="text", nullable=true)
  23.          */
  24.         private ?string $seoRightBlockEn,
  25.         /**
  26.          * @ORM\Column(type="text", nullable=true)
  27.          */
  28.         private ?string $seoLeftBlockEn,
  29.     ){}
  30.     /**
  31.      * @return string|null
  32.      */
  33.     public function getSeoRightBlockPl(): ?string
  34.     {
  35.         return $this->seoRightBlockPl;
  36.     }
  37.     /**
  38.      * @return string|null
  39.      */
  40.     public function getSeoLeftBlockPl(): ?string
  41.     {
  42.         return $this->seoLeftBlockPl;
  43.     }
  44.     /**
  45.      * @return string|null
  46.      */
  47.     public function getSeoRightBlockEn(): ?string
  48.     {
  49.         return $this->seoRightBlockEn;
  50.     }
  51.     /**
  52.      * @return string|null
  53.      */
  54.     public function getSeoLeftBlockEn(): ?string
  55.     {
  56.         return $this->seoLeftBlockEn;
  57.     }
  58.     public static function createSeoMainPage(array $params): self
  59.     {
  60.         return new self($params['seoRightBlockPl'], $params['seoLeftBlockPl'], $params['seoRightBlockEn'], $params['seoLeftBlockEn']);
  61.     }
  62.     public function updateSeoMainPage(array $params): void
  63.     {
  64.         $this->seoRightBlockPl = $params['seoRightBlockPl'];
  65.         $this->seoLeftBlockPl  = $params['seoLeftBlockPl'];
  66.         $this->seoRightBlockEn = $params['seoRightBlockEn'];
  67.         $this->seoLeftBlockEn  = $params['seoLeftBlockEn'];
  68.     }
  69. }