src/OfficeBrain/Bundle/ServiceGroupBundle/Entity/ServiceRuleMainCondition.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\OfficeBrain\Bundle\ServiceGroupBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. /**
  6.  * ServiceRuleMainCondition.
  7.  *
  8.  * @ORM\Table(name="tbl_service_rule_main_condition")
  9.  * @ORM\Entity(repositoryClass="App\OfficeBrain\Bundle\ServiceGroupBundle\Entity\ServiceRuleMainConditionRepository")
  10.  */
  11. class ServiceRuleMainCondition
  12. {
  13.     /**
  14.      * @var int
  15.      *
  16.      * @ORM\Column(name="id", type="bigint",length=20, options={"unsigned"=true})
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\OneToMany(targetEntity="ServiceRuleInnerCondition", mappedBy="serviceRuleMainConditionId", cascade={"persist"})
  23.      */
  24.     private $serviceRuleInnerConditionId;
  25.     /**
  26.      * @var int
  27.      *
  28.      * @ORM\ManyToOne(targetEntity="ServiceRuleMaster", inversedBy="serviceRuleMainConditionId")
  29.      * @ORM\JoinColumn(name="service_rule_master_id", referencedColumnName="id")
  30.      */
  31.     private $serviceRuleMasterId;
  32.     /**
  33.      * @var int
  34.      *
  35.      * @ORM\Column(name="parent_id", type="bigint",length=20, options={"unsigned"=true})
  36.      */
  37.     private $parentId;
  38.     /**
  39.      * @var string
  40.      *
  41.      * @ORM\Column(name="main_condition", type="string", length=255)
  42.      */
  43.     private $mainCondition;
  44.     /**
  45.      * @var bool
  46.      *
  47.      * @ORM\Column(name="if_condition_is", type="boolean")
  48.      */
  49.     private $ifConditionIs true;
  50.     /**
  51.      * @var \DateTime
  52.      * @Gedmo\Timestampable(on="create")
  53.      * @ORM\Column(name="created_at", type="datetime", nullable=true)
  54.      */
  55.     private $createdAt;
  56.     /**
  57.      * @var \DateTime
  58.      * @Gedmo\Timestampable(on="update")
  59.      * @ORM\Column(name="updated_at", type="datetime", nullable=true)
  60.      */
  61.     private $updatedAt;
  62.     /**
  63.      * @var \DateTime
  64.      *
  65.      * @ORM\Column(name="deleted_at", type="datetime", nullable=true)
  66.      */
  67.     private $deletedAt;
  68.     /**
  69.      * @var int
  70.      * @ORM\Column(name="created_uid", type="bigint" ,length=20 ,options={"unsigned"=true}, nullable=true)
  71.      */
  72.     private $createdUid;
  73.     /**
  74.      * @var int
  75.      * @ORM\Column(name="updated_uid", type="bigint" ,length=20 ,options={"unsigned"=true}, nullable=true)
  76.      */
  77.     private $updatedUid;
  78.     /**
  79.      * @var int
  80.      * @ORM\Column(name="deleted_uid", type="bigint" ,length=20 ,options={"unsigned"=true}, nullable=true)
  81.      */
  82.     private $deletedUid;
  83.     /**
  84.      * Set id.
  85.      *
  86.      * @param int $id
  87.      *
  88.      * @return ServiceRuleMainCondition
  89.      */
  90.     public function setId($id)
  91.     {
  92.         $this->id $id;
  93.         return $this;
  94.     }
  95.     /**
  96.      * Get id.
  97.      *
  98.      * @return int
  99.      */
  100.     public function getId()
  101.     {
  102.         return $this->id;
  103.     }
  104.     /**
  105.      * Set serviceRuleMasterId.
  106.      *
  107.      * @param int $serviceRuleMasterId
  108.      *
  109.      * @return ServiceRuleMainCondition
  110.      */
  111.     public function setServiceRuleMasterId($serviceRuleMasterId)
  112.     {
  113.         $this->serviceRuleMasterId $serviceRuleMasterId;
  114.         return $this;
  115.     }
  116.     /**
  117.      * Get serviceRuleMasterId.
  118.      *
  119.      * @return int
  120.      */
  121.     public function getServiceRuleMasterId()
  122.     {
  123.         return $this->serviceRuleMasterId;
  124.     }
  125.     /**
  126.      * Set parentId.
  127.      *
  128.      * @param int $parentId
  129.      *
  130.      * @return ServiceRuleMainCondition
  131.      */
  132.     public function setParentId($parentId)
  133.     {
  134.         $this->parentId $parentId;
  135.         return $this;
  136.     }
  137.     /**
  138.      * Get parentId.
  139.      *
  140.      * @return int
  141.      */
  142.     public function getParentId()
  143.     {
  144.         return $this->parentId;
  145.     }
  146.     /**
  147.      * Set mainCondition.
  148.      *
  149.      * @param string $mainCondition
  150.      *
  151.      * @return ServiceRuleMainCondition
  152.      */
  153.     public function setMainCondition($mainCondition)
  154.     {
  155.         $this->mainCondition $mainCondition;
  156.         return $this;
  157.     }
  158.     /**
  159.      * Get mainCondition.
  160.      *
  161.      * @return string
  162.      */
  163.     public function getMainCondition()
  164.     {
  165.         return $this->mainCondition;
  166.     }
  167.     /**
  168.      * Set ifConditionIs.
  169.      *
  170.      * @param bool $ifConditionIs
  171.      *
  172.      * @return ServiceRuleMainCondition
  173.      */
  174.     public function setIfConditionIs($ifConditionIs null)
  175.     {
  176.         $this->ifConditionIs = ($ifConditionIs == null true $ifConditionIs);
  177.         return $this;
  178.     }
  179.     /**
  180.      * Get ifConditionIs.
  181.      *
  182.      * @return bool
  183.      */
  184.     public function getIfConditionIs()
  185.     {
  186.         return $this->ifConditionIs;
  187.     }
  188.     public function __construct()
  189.     {
  190.         $this->serviceRuleInnerConditionId = new \Doctrine\Common\Collections\ArrayCollection();
  191.     }
  192.     public function addServiceRuleInnerConditionId(ServiceRuleInnerCondition $serviceRuleInnerConditionId)
  193.     {
  194.         $this->serviceRuleInnerConditionId->add($serviceRuleInnerConditionId);
  195.         return $this;
  196.     }
  197.     public function removeServiceRuleInnerConditionId(ServiceRuleInnerCondition $serviceRuleInnerConditionId)
  198.     {
  199.         $this->serviceRuleInnerConditionId->removeElement($serviceRuleInnerConditionId);
  200.         return $this;
  201.     }
  202.     public function getServiceRuleInnerConditionId()
  203.     {
  204.         return $this->serviceRuleInnerConditionId;
  205.     }
  206.     /**
  207.      * Set createdAt.
  208.      *
  209.      * @param \DateTime $createdAt
  210.      *
  211.      * @return ServiceRuleMainCondition
  212.      */
  213.     public function setCreatedAt($createdAt)
  214.     {
  215.         $this->createdAt $createdAt;
  216.         return $this;
  217.     }
  218.     /**
  219.      * Get createdAt.
  220.      *
  221.      * @return \DateTime
  222.      */
  223.     public function getCreatedAt()
  224.     {
  225.         return $this->createdAt;
  226.     }
  227.     /**
  228.      * Set updatedAt.
  229.      *
  230.      * @param \DateTime $updatedAt
  231.      *
  232.      * @return ServiceRuleMainCondition
  233.      */
  234.     public function setUpdatedAt($updatedAt)
  235.     {
  236.         $this->updatedAt $updatedAt;
  237.         return $this;
  238.     }
  239.     /**
  240.      * Get updatedAt.
  241.      *
  242.      * @return \DateTime
  243.      */
  244.     public function getUpdatedAt()
  245.     {
  246.         return $this->updatedAt;
  247.     }
  248.     /**
  249.      * Set deletedAt.
  250.      *
  251.      * @param \DateTime $deletedAt
  252.      *
  253.      * @return ServiceRuleMainCondition
  254.      */
  255.     public function setDeletedAt($deletedAt)
  256.     {
  257.         $this->deletedAt $deletedAt;
  258.         return $this;
  259.     }
  260.     /**
  261.      * Get deletedAt.
  262.      *
  263.      * @return \DateTime
  264.      */
  265.     public function getDeletedAt()
  266.     {
  267.         return $this->deletedAt;
  268.     }
  269.     /**
  270.      * Set createdUid.
  271.      *
  272.      * @param int $createdUid
  273.      *
  274.      * @return ServiceRuleMainCondition
  275.      */
  276.     public function setCreatedUid($createdUid)
  277.     {
  278.         $this->createdUid $createdUid;
  279.         return $this;
  280.     }
  281.     /**
  282.      * Get createdUid.
  283.      *
  284.      * @return int
  285.      */
  286.     public function getCreatedUid()
  287.     {
  288.         return $this->createdUid;
  289.     }
  290.     /**
  291.      * Set updatedUid.
  292.      *
  293.      * @param int $updatedUid
  294.      *
  295.      * @return ServiceRuleMainCondition
  296.      */
  297.     public function setUpdatedUid($updatedUid)
  298.     {
  299.         $this->updatedUid $updatedUid;
  300.         return $this;
  301.     }
  302.     /**
  303.      * Get updatedUid.
  304.      *
  305.      * @return int
  306.      */
  307.     public function getUpdatedUid()
  308.     {
  309.         return $this->updatedUid;
  310.     }
  311.     /**
  312.      * Set deletedUid.
  313.      *
  314.      * @param int $deletedUid
  315.      *
  316.      * @return ServiceRuleMainCondition
  317.      */
  318.     public function setDeletedUid($deletedUid)
  319.     {
  320.         $this->deletedUid $deletedUid;
  321.         return $this;
  322.     }
  323.     /**
  324.      * Get deletedUid.
  325.      *
  326.      * @return int
  327.      */
  328.     public function getDeletedUid()
  329.     {
  330.         return $this->deletedUid;
  331.     }
  332.     public function __clone()
  333.     {
  334.         $serviceRuleInnerConditionIdArray $this->getServiceRuleInnerConditionId();
  335.         if ($serviceRuleInnerConditionIdArray) {
  336.             $this->serviceRuleInnerConditionId = new \Doctrine\Common\Collections\ArrayCollection();
  337.             foreach ($serviceRuleInnerConditionIdArray as $serviceRuleInnerCondition) {
  338.                 $copyServiceRuleInnerCondition = clone $serviceRuleInnerCondition;
  339.                 $copyServiceRuleInnerCondition->setId(null);
  340.                 $copyServiceRuleInnerCondition->setServiceRuleMainConditionId($this);
  341.                 $this->addServiceRuleInnerConditionId($copyServiceRuleInnerCondition);
  342.             }
  343.         }
  344.     }
  345. }