src/Entity/Mail.php line 17

Open in your IDE?
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: fmartinbrossat
  5.  * Date: 2018-12-21
  6.  * Time: 08:54
  7.  */
  8. namespace App\Entity;
  9. use Doctrine\ORM\Mapping as ORM;
  10. /**
  11.  * @ORM\Entity
  12.  * @ORM\Table(name="mail_history")
  13.  */
  14. class Mail
  15. {
  16.     const IDENT_MAIL_TYPE_CS_READY 'CSREADY';
  17.     /**
  18.      * @ORM\Column(type="integer")
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue(strategy="AUTO")
  21.      */
  22.     protected $id;
  23.     /**
  24.      * @ORM\Column(name="type", type="text")
  25.      */
  26.     protected $type;
  27.     /**
  28.      * @ORM\Column(name="date", type="datetime")
  29.      */
  30.     protected $date;
  31.     /**
  32.      * @ORM\Column(name="sender", type="text")
  33.      */
  34.     protected $sender;
  35.     /**
  36.      * Many mail have One Client.
  37.      * @ORM\ManyToOne(targetEntity="Clients", inversedBy="mailsReceive")
  38.      * @ORM\JoinColumn(name="clientReceive", referencedColumnName="id")
  39.      */
  40.     protected $receivers;
  41.     /**
  42.      * Many mail have One User.
  43.      * @ORM\ManyToOne(targetEntity="SysUsers", inversedBy="mailHistory")
  44.      * @ORM\JoinColumn(name="userSender", referencedColumnName="id")
  45.      */
  46.     protected $userSender;
  47.     /**
  48.      * @var string
  49.      */
  50.     protected $subject;
  51.     /**
  52.      * @var string
  53.      */
  54.     protected $content;
  55.     /**
  56.      * @return int
  57.      */
  58.     public function getId()
  59.     {
  60.         return $this->id;
  61.     }
  62.     /**
  63.      * @param int $id
  64.      */
  65.     public function setId($id)
  66.     {
  67.         $this->id $id;
  68.     }
  69.     /**
  70.      * @return string
  71.      */
  72.     public function getType()
  73.     {
  74.         return $this->type;
  75.     }
  76.     /**
  77.      * @param string $type
  78.      */
  79.     public function setType($type)
  80.     {
  81.         $this->type $type;
  82.     }
  83.     /**
  84.      * @return \Datetime
  85.      */
  86.     public function getDate()
  87.     {
  88.         return $this->date;
  89.     }
  90.     /**
  91.      * @param \Datetime $date
  92.      */
  93.     public function setDate($date)
  94.     {
  95.         $this->date $date;
  96.     }
  97.     /**
  98.      * @return mixed
  99.      */
  100.     public function getUserSender()
  101.     {
  102.         return $this->userSender;
  103.     }
  104.     /**
  105.      * @param mixed $userSender
  106.      */
  107.     public function setUserSender($userSender)
  108.     {
  109.         $this->userSender $userSender;
  110.     }
  111.     /**
  112.      * @return string
  113.      */
  114.     public function getSender()
  115.     {
  116.         return $this->sender;
  117.     }
  118.     /**
  119.      * @param string $sender
  120.      */
  121.     public function setSender($sender)
  122.     {
  123.         $this->sender $sender;
  124.     }
  125.     /**
  126.      * @return mixed
  127.      */
  128.     public function getReceivers()
  129.     {
  130.         return $this->receivers;
  131.     }
  132.     /**
  133.      * @param mixed $receivers
  134.      */
  135.     public function setReceivers($receivers)
  136.     {
  137.         $this->receivers $receivers;
  138.     }
  139.     /**
  140.      * @return string
  141.      */
  142.     public function getSubject()
  143.     {
  144.         return $this->subject;
  145.     }
  146.     /**
  147.      * @param string $subject
  148.      */
  149.     public function setSubject($subject)
  150.     {
  151.         $this->subject $subject;
  152.     }
  153.     /**
  154.      * @return string
  155.      */
  156.     public function getContent()
  157.     {
  158.         return $this->content;
  159.     }
  160.     /**
  161.      * @param string $content
  162.      */
  163.     public function setContent($content)
  164.     {
  165.         $this->content $content;
  166.     }
  167.     /**
  168.      * @return string
  169.      */
  170.     public function getTypeText() {
  171.         switch ($this->getType()) {
  172.             case self::IDENT_MAIL_TYPE_CS_READY:
  173.                 return "Commande spĂ©ciale prĂȘte";
  174.                 break;
  175.         }
  176.     }
  177. }