src/Entity/EmailTemplate.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Knp\DoctrineBehaviors\Contract\Entity\SoftDeletableInterface;
  4. use Knp\DoctrineBehaviors\Model\SoftDeletable\SoftDeletableTrait;
  5. use Knp\DoctrineBehaviors\Model\Blameable\BlameableTrait;
  6. use Knp\DoctrineBehaviors\Contract\Entity\BlameableInterface;
  7. use Knp\DoctrineBehaviors\Model\Timestampable\TimestampableTrait;
  8. use Knp\DoctrineBehaviors\Contract\Entity\TimestampableInterface;
  9. /**
  10.  * @Doctrine\ORM\Mapping\Entity
  11.  * @Doctrine\ORM\Mapping\Table(name="email_template")
  12.  */
  13. class EmailTemplate implements BlameableInterfaceTimestampableInterfaceSoftDeletableInterface  {
  14.     use BlameableTrait;
  15.     use TimestampableTrait;
  16.     
  17.     use SoftDeletableTrait;
  18.     
  19. /**
  20.      * @Doctrine\ORM\Mapping\Id
  21.      * @Doctrine\ORM\Mapping\Column(type="integer")
  22.      * @Doctrine\ORM\Mapping\GeneratedValue(strategy="AUTO")
  23.      */
  24.     protected $id;
  25.     /**
  26.      * nazwa wyświetlana w select
  27.      * @Doctrine\ORM\Mapping\Column(type="string", length=255, nullable=false)
  28.      */
  29.     protected $name;
  30.     /**
  31.      * temat
  32.      * @Doctrine\ORM\Mapping\Column(type="string", length=255, nullable=false)
  33.      */
  34.     protected $subject;
  35.     /**
  36.      * treść
  37.      * @Doctrine\ORM\Mapping\Column(type="text", nullable=false)
  38.      */
  39.     protected $content;
  40.     /**
  41.      * code_name - dla zapytań
  42.      * @Doctrine\ORM\Mapping\Column(type="string", length=255, nullable=false)
  43.      */
  44.     protected $codeName;
  45.     /**
  46.      * Wyróżnienie tagów na niebiesko w podglądzie, zgodnie z taskiem 7952
  47.      * @param $tags
  48.      * @return mixed
  49.      */
  50.     public function getPreviewContent($tags) {
  51.         $content $this->getContent();
  52.         foreach ($tags as $tag) {
  53.             $content str_replace('{'.$tag.'}''<span style="color:#299bea;">{'.$tag.'}</span>'$content);
  54.         }
  55.         return $content;
  56.     }
  57.     public function getId()
  58.     {
  59.         return $this->id;
  60.     }
  61.     public function getSubject()
  62.     {
  63.         return $this->subject;
  64.     }
  65.     public function getContent()
  66.     {
  67.         return $this->content;
  68.     }
  69.     public function setSubject($subject)
  70.     {
  71.         $this->subject $subject;
  72.         return $this;
  73.     }
  74.     public function setContent($content)
  75.     {
  76.         $this->content $content;
  77.         return $this;
  78.     }
  79.     public function getName()
  80.     {
  81.         return $this->name;
  82.     }
  83.     public function setName($name)
  84.     {
  85.         $this->name $name;
  86.         return $this;
  87.     }
  88.     public function getCodeName()
  89.     {
  90.         return $this->codeName;
  91.     }
  92.     public function setCodeName($codeName)
  93.     {
  94.         $this->codeName $codeName;
  95.         return $this;
  96.     }
  97. }