src/OfficeBrain/Bundle/EmailBundle/Entity/EmailTemplateMaster.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\OfficeBrain\Bundle\EmailBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints as DoctrineAssert;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. /**
  8.  *
  9.  * @author OfficeBrain 4795 <info@officebrain.com>
  10.  *
  11.  * Description: Master table of email template
  12.  *
  13.  */
  14. /**
  15.  * EmailTemplateMaster
  16.  *
  17.  * @ORM\Table(name="tbl_email_template_master")
  18.  * @ORM\Entity(repositoryClass="App\OfficeBrain\Bundle\EmailBundle\Entity\EmailTemplateMasterRepository")
  19.  */
  20. class EmailTemplateMaster
  21. {
  22.     /**
  23.      * @var integer
  24.      *
  25.      * @ORM\Column(name="id", type="bigint", options={"unsigned":true})
  26.      * @ORM\Id
  27.      * @ORM\GeneratedValue(strategy="AUTO")
  28.      */
  29.     private $id;
  30.     
  31.     /**
  32.      * @var string
  33.      * @ORM\Column(name="instance_type", type="string", length=255)
  34.      */
  35.     private $instanceType;
  36.     
  37.     /**
  38.      * @var integer
  39.      *
  40.      * @ORM\Column(name="instance_id", type="integer")
  41.      */
  42.     private $instanceId;
  43.     
  44.     /**
  45.      * @var integer
  46.      *
  47.      * @ORM\Column(name="country_id", type="integer", nullable=true)
  48.      */
  49.     public $countryId;
  50.     
  51.     /**
  52.      * @var string
  53.      * @Assert\NotBlank(message="email.form.not_blank")
  54.      * @ORM\Column(name="name", type="string", length=255)
  55.      */
  56.     private $name;
  57.     /**
  58.      * @var string
  59.      * @ORM\Column(name="description", type="string", length=255, nullable=true)
  60.      */
  61.     private $description;
  62.     
  63.     /**
  64.      * @ORM\ManyToOne(targetEntity="EmailTemplateHeaderMaster")
  65.      * @ORM\JoinColumn(name="header", referencedColumnName="id", nullable=true)
  66.      */
  67.     private $header;
  68.     
  69.     /**
  70.      * @ORM\OneToMany(targetEntity="\App\OfficeBrain\Bundle\EmailBundle\Entity\EmailTemplateLanguage", mappedBy="templateId", cascade={"all"})
  71.      */
  72.     protected $content;
  73.     
  74.     /**
  75.      * @var string
  76.      *
  77.      * @ORM\Column(name="is_detault", type="boolean", nullable=true)
  78.      */
  79.     private $isDefault;
  80.     
  81.     /**
  82.      * @ORM\Column(type="string", name="status", length=100, options={"default" = "0"})
  83.      * @Assert\NotBlank(message="email.form.not_blank")
  84.      */
  85.     private $status;
  86.     
  87.     /**
  88.      * @var integer
  89.      *
  90.      * @ORM\Column(name="created_uid", type="integer")
  91.      */
  92.     private $createdUid;
  93.     
  94.     /**
  95.      * @ORM\Column(type="datetime", name="created_at")
  96.      */
  97.     protected $createdAt;
  98.     /**
  99.      * @var integer
  100.      *
  101.      * @ORM\Column(name="updated_uid", type="integer", nullable=true)
  102.      */
  103.     private $updatedUid;
  104.     
  105.     /**
  106.      * @ORM\Column(type="datetime", name="updated_at", nullable=true)
  107.      */
  108.     protected $updatedAt;
  109.     
  110.     /**
  111.      * @var integer
  112.      *
  113.      * @ORM\Column(name="deleted_uid", type="integer", nullable=true)
  114.      */
  115.     private $deletedUid;
  116.     
  117.     /**
  118.      * @ORM\Column(type="datetime", name="deleted_at", nullable=true)
  119.      */
  120.     protected $deletedAt;
  121.     
  122.     
  123.     public function __construct()
  124.     {
  125.         $this->content = new ArrayCollection();
  126.     }
  127.     
  128.     
  129.     /**
  130.      * Get id
  131.      *
  132.      * @return integer
  133.      */
  134.     public function getId()
  135.     {
  136.         return $this->id;
  137.     }
  138.     /**
  139.      * Set instanceType
  140.      *
  141.      * @param string $instanceType
  142.      * @return EmailTemplateMaster
  143.      */
  144.     public function setInstanceType($instanceType)
  145.     {
  146.         $this->instanceType $instanceType;
  147.         return $this;
  148.     }
  149.     /**
  150.      * Get instanceType
  151.      *
  152.      * @return string
  153.      */
  154.     public function getInstanceType()
  155.     {
  156.         return $this->instanceType;
  157.     }
  158.     /**
  159.      * Set instanceId
  160.      *
  161.      * @param integer $instanceId
  162.      * @return EmailTemplateMaster
  163.      */
  164.     public function setInstanceId($instanceId)
  165.     {
  166.         $this->instanceId $instanceId;
  167.         return $this;
  168.     }
  169.     /**
  170.      * Get instanceId
  171.      *
  172.      * @return integer
  173.      */
  174.     public function getInstanceId()
  175.     {
  176.         return $this->instanceId;
  177.     }
  178.     /**
  179.      * Set name
  180.      *
  181.      * @param string $name
  182.      * @return EmailTemplateMaster
  183.      */
  184.     public function setName($name)
  185.     {
  186.         $this->name $name;
  187.         return $this;
  188.     }
  189.     /**
  190.      * Get name
  191.      *
  192.      * @return string
  193.      */
  194.     public function getName()
  195.     {
  196.         return $this->name;
  197.     }
  198.     /**
  199.      * Set createdUid
  200.      *
  201.      * @param integer $createdUid
  202.      * @return EmailTemplateMaster
  203.      */
  204.     public function setCreatedUid($createdUid)
  205.     {
  206.         $this->createdUid $createdUid;
  207.         return $this;
  208.     }
  209.     /**
  210.      * Get createdUid
  211.      *
  212.      * @return integer
  213.      */
  214.     public function getCreatedUid()
  215.     {
  216.         return $this->createdUid;
  217.     }
  218.     /**
  219.      * Set createdAt
  220.      *
  221.      * @param \DateTime $createdAt
  222.      * @return EmailTemplateMaster
  223.      */
  224.     public function setCreatedAt($createdAt)
  225.     {
  226.         $this->createdAt $createdAt;
  227.         return $this;
  228.     }
  229.     /**
  230.      * Get createdAt
  231.      *
  232.      * @return \DateTime
  233.      */
  234.     public function getCreatedAt()
  235.     {
  236.         return $this->createdAt;
  237.     }
  238.     /**
  239.      * Set updatedUid
  240.      *
  241.      * @param integer $updatedUid
  242.      * @return EmailTemplateMaster
  243.      */
  244.     public function setUpdatedUid($updatedUid)
  245.     {
  246.         $this->updatedUid $updatedUid;
  247.         return $this;
  248.     }
  249.     /**
  250.      * Get updatedUid
  251.      *
  252.      * @return integer
  253.      */
  254.     public function getUpdatedUid()
  255.     {
  256.         return $this->updatedUid;
  257.     }
  258.     /**
  259.      * Set updatedAt
  260.      *
  261.      * @param \DateTime $updatedAt
  262.      * @return EmailTemplateMaster
  263.      */
  264.     public function setUpdatedAt($updatedAt)
  265.     {
  266.         $this->updatedAt $updatedAt;
  267.         return $this;
  268.     }
  269.     /**
  270.      * Get updatedAt
  271.      *
  272.      * @return \DateTime
  273.      */
  274.     public function getUpdatedAt()
  275.     {
  276.         return $this->updatedAt;
  277.     }
  278.     /**
  279.      * Set deletedUid
  280.      *
  281.      * @param integer $deletedUid
  282.      * @return EmailTemplateMaster
  283.      */
  284.     public function setDeletedUid($deletedUid)
  285.     {
  286.         $this->deletedUid $deletedUid;
  287.         return $this;
  288.     }
  289.     /**
  290.      * Get deletedUid
  291.      *
  292.      * @return integer
  293.      */
  294.     public function getDeletedUid()
  295.     {
  296.         return $this->deletedUid;
  297.     }
  298.     /**
  299.      * Set deletedAt
  300.      *
  301.      * @param \DateTime $deletedAt
  302.      * @return EmailTemplateMaster
  303.      */
  304.     public function setDeletedAt($deletedAt)
  305.     {
  306.         $this->deletedAt $deletedAt;
  307.         return $this;
  308.     }
  309.     /**
  310.      * Get deletedAt
  311.      *
  312.      * @return \DateTime
  313.      */
  314.     public function getDeletedAt()
  315.     {
  316.         return $this->deletedAt;
  317.     }
  318.     /**
  319.      * Add content
  320.      *
  321.      * @param \App\OfficeBrain\Bundle\EmailBundle\Entity\EmailTemplateLanguage $content
  322.      * @return EmailTemplateMaster
  323.      */
  324.     public function addContent(\App\OfficeBrain\Bundle\EmailBundle\Entity\EmailTemplateLanguage $content)
  325.     {
  326.         $this->content[] = $content;
  327.         return $this;
  328.     }
  329.     /**
  330.      * Remove content
  331.      *
  332.      * @param \App\OfficeBrain\Bundle\EmailBundle\Entity\EmailTemplateLanguage $content
  333.      */
  334.     public function removeContent(\App\OfficeBrain\Bundle\EmailBundle\Entity\EmailTemplateLanguage $content)
  335.     {
  336.         $this->content->removeElement($content);
  337.     }
  338.     
  339.     public function setContent($content)
  340.     {
  341.         foreach ($content as $contentval) {
  342.             $contentval->setHeaderId($this);
  343.         }
  344.         $this->content $content;
  345.     }
  346.     
  347.     
  348.     /**
  349.      * Get content
  350.      *
  351.      * @return \Doctrine\Common\Collections\Collection
  352.      */
  353.     public function getContent()
  354.     {
  355.         return $this->content;
  356.     }
  357.     
  358.     public function __toString()
  359.     {
  360.         return $this->getName();
  361.     }
  362.    
  363.     /**
  364.      * Set isDefault
  365.      *
  366.      * @param boolean $isDefault
  367.      * @return EmailTemplateMaster
  368.      */
  369.     public function setIsDefault($isDefault)
  370.     {
  371.         $this->isDefault $isDefault;
  372.         return $this;
  373.     }
  374.     /**
  375.      * Get isDefault
  376.      *
  377.      * @return boolean
  378.      */
  379.     public function getIsDefault()
  380.     {
  381.         return $this->isDefault;
  382.     }
  383.     /**
  384.      * Set status
  385.      *
  386.      * @param string $status
  387.      * @return EmailTemplateMaster
  388.      */
  389.     public function setStatus($status)
  390.     {
  391.         $this->status $status;
  392.         return $this;
  393.     }
  394.     /**
  395.      * Get status
  396.      *
  397.      * @return string
  398.      */
  399.     public function getStatus()
  400.     {
  401.         return $this->status;
  402.     }
  403.     /**
  404.      * Set description
  405.      *
  406.      * @param string $description
  407.      * @return EmailTemplateMaster
  408.      */
  409.     public function setDescription($description)
  410.     {
  411.         $this->description $description;
  412.         return $this;
  413.     }
  414.     /**
  415.      * Get description
  416.      *
  417.      * @return string
  418.      */
  419.     public function getDescription()
  420.     {
  421.         return $this->description;
  422.     }
  423.     /**
  424.      * Set header
  425.      *
  426.      * @param \App\OfficeBrain\Bundle\EmailBundle\Entity\EmailTemplateHeaderMaster $header
  427.      * @return EmailTemplateMaster
  428.      */
  429.     public function setHeader(\App\OfficeBrain\Bundle\EmailBundle\Entity\EmailTemplateHeaderMaster $header null)
  430.     {
  431.         $this->header $header;
  432.         return $this;
  433.     }
  434.     /**
  435.      * Get header
  436.      *
  437.      * @return \App\OfficeBrain\Bundle\EmailBundle\Entity\EmailTemplateHeaderMaster
  438.      */
  439.     public function getHeader()
  440.     {
  441.         return $this->header;
  442.     }
  443.     /**
  444.      * Set countryId
  445.      *
  446.      * @param integer $countryId
  447.      * @return EmailTemplateMaster
  448.      */
  449.     public function setCountryId($countryId)
  450.     {
  451.         $this->countryId $countryId;
  452.         return $this;
  453.     }
  454.     /**
  455.      * Get countryId
  456.      *
  457.      * @return integer
  458.      */
  459.     public function getCountryId()
  460.     {
  461.         return $this->countryId;
  462.     }
  463. }