src/Entity/MailModuleTestsSettings.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MailModuleTestsSettingsRepository;
  4. use Doctrine\ORM\Mapping\UniqueConstraint;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use EightMarq\CoreComponent\Entity\BaseEntity;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use function Symfony\Component\String\u;
  9. /**
  10.  * @ORM\Table(name="mail_module_tests_settings", uniqueConstraints={
  11.  *     @UniqueConstraint(columns={"type"})
  12.  * })
  13.  *
  14.  * @ORM\Entity(repositoryClass=MailModuleTestsSettingsRepository::class)
  15.  */
  16. class MailModuleTestsSettings extends BaseEntity
  17. {
  18.     /**
  19.      * @var string
  20.      *
  21.      * @ORM\Column(type="string", length=255)
  22.      *
  23.      * FormField(
  24.      *     options={"label": "form.label_type"}
  25.      * )
  26.      *
  27.      * ListField(
  28.      *     fieldDescriptionOptions={"label": "list.label_type"}
  29.      * )
  30.      *
  31.      * @Assert\NotBlank()
  32.      */
  33.     private $type;
  34.     /**
  35.      * @ORM\Column(type="json")
  36.      * @Assert\NotBlank()
  37.      */
  38.     private $data = [];
  39.     public function getType(): ?string
  40.     {
  41.         return $this->type;
  42.     }
  43.     public function setType(string $type): void
  44.     {
  45.         $this->type $type;
  46.     }
  47.     public function getData(): ?array
  48.     {
  49.         return $this->data;
  50.     }
  51.     public function setData(array $data): self
  52.     {
  53.         $this->data $data;
  54.         return $this;
  55.     }
  56.     public function __toString()
  57.     {
  58.         return "";
  59. //        return 'fields.label_' . str_replace('.', '_', u($this->getType())->lower()->snake());
  60.     }
  61. }