custom/plugins/SasBlogModule/src/Content/BlogAuthor/BlogAuthorEntity.php line 10

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Sas\BlogModule\Content\BlogAuthor;
  3. use Sas\BlogModule\Content\Blog\BlogEntriesCollection;
  4. use Sas\BlogModule\Content\BlogAuthor\BlogAuthorTranslation\BlogAuthorTranslationCollection;
  5. use Shopware\Core\Framework\DataAbstractionLayer\Entity;
  6. use Shopware\Core\Framework\DataAbstractionLayer\EntityIdTrait;
  7. use Shopware\Core\System\Salutation\SalutationEntity;
  8. class BlogAuthorEntity extends Entity
  9. {
  10.     use EntityIdTrait;
  11.     /**
  12.      * @var string
  13.      */
  14.     protected $firstName;
  15.     /**
  16.      * @var string
  17.      */
  18.     protected $lastName;
  19.     /**
  20.      * @var string
  21.      */
  22.     protected $email;
  23.     /**
  24.      * @var string|null
  25.      */
  26.     protected $displayName;
  27.     /**
  28.      * @var string
  29.      */
  30.     protected $salutationId;
  31.     /**
  32.      * @var SalutationEntity|null
  33.      */
  34.     protected $salutation;
  35.     /**
  36.      * @var BlogAuthorTranslationCollection|null
  37.      */
  38.     protected $translations;
  39.     /**
  40.      * @var BlogEntriesCollection|null
  41.      */
  42.     protected $blogs;
  43.     public function getTranslations(): ?BlogAuthorTranslationCollection
  44.     {
  45.         return $this->translations;
  46.     }
  47.     public function setTranslations(BlogAuthorTranslationCollection $translations): void
  48.     {
  49.         $this->translations $translations;
  50.     }
  51.     public function getBlogs(): ?BlogEntriesCollection
  52.     {
  53.         return $this->blogs;
  54.     }
  55.     public function setBlogs(BlogEntriesCollection $blogs): void
  56.     {
  57.         $this->blogs $blogs;
  58.     }
  59.     public function getSalutation(): ?SalutationEntity
  60.     {
  61.         return $this->salutation;
  62.     }
  63.     public function setSalutation(SalutationEntity $salutation): void
  64.     {
  65.         $this->salutation $salutation;
  66.     }
  67.     public function getSalutationId(): string
  68.     {
  69.         return $this->salutationId;
  70.     }
  71.     public function setSalutationId(string $salutationId): void
  72.     {
  73.         $this->salutationId $salutationId;
  74.     }
  75.     public function getFirstName(): string
  76.     {
  77.         return $this->firstName;
  78.     }
  79.     public function setFirstName(string $firstName): void
  80.     {
  81.         $this->firstName $firstName;
  82.     }
  83.     public function getLastName(): string
  84.     {
  85.         return $this->lastName;
  86.     }
  87.     public function setLastName(string $lastName): void
  88.     {
  89.         $this->lastName $lastName;
  90.     }
  91.     public function getEmail(): string
  92.     {
  93.         return $this->email;
  94.     }
  95.     public function setEmail(string $email): void
  96.     {
  97.         $this->email $email;
  98.     }
  99.     public function getDisplayName(): ?string
  100.     {
  101.         return $this->displayName;
  102.     }
  103.     public function setDisplayName(?string $displayName): void
  104.     {
  105.         $this->displayName $displayName;
  106.     }
  107.     public function getTranslated(): array
  108.     {
  109.         $translated parent::getTranslated();
  110.         $translated['name'] = $this->getFirstName() . ' ' $this->getLastName();
  111.         return $translated;
  112.     }
  113. }