src/OfficeBrain/Bundle/ServiceGroupBundle/Entity/ServiceRuleMaster.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.  * ServiceRuleMaster.
  7.  *
  8.  * @ORM\Table(name="tbl_service_rule_master")
  9.  * @ORM\Entity(repositoryClass="App\OfficeBrain\Bundle\ServiceGroupBundle\Entity\ServiceRuleMasterRepository")
  10.  */
  11. class ServiceRuleMaster
  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.      * @var string
  23.      *
  24.      * @ORM\Column(name="rule_name", type="string", length=255, nullable=false)
  25.      */
  26.     private $ruleName;
  27.     /**
  28.      * @var string
  29.      *
  30.      * @ORM\Column(name="rule_type", type="string", length=50)
  31.      */
  32.     private $ruleType;
  33.     /**
  34.      * @var int
  35.      *
  36.      * @ORM\Column(name="status", type="integer", length=4)
  37.      */
  38.     private $status 1;
  39.     /**
  40.      * @var int
  41.      *
  42.      * @ORM\Column(name="country_id", type="bigint",length=20, options={"unsigned"=true})
  43.      */
  44.     private $countryId;
  45.     /**
  46.      * @ORM\OneToMany(targetEntity="ServiceRuleMainCondition", mappedBy="serviceRuleMasterId", cascade={"persist"})
  47.      */
  48.     private $serviceRuleMainConditionId;
  49.     /**
  50.      * @var \DateTime
  51.      * @Gedmo\Timestampable(on="create")
  52.      * @ORM\Column(name="created_at", type="datetime")
  53.      */
  54.     private $createdAt;
  55.     /**
  56.      * @var \DateTime
  57.      * @Gedmo\Timestampable(on="update")
  58.      * @ORM\Column(name="updated_at", type="datetime", nullable=true)
  59.      */
  60.     private $updatedAt;
  61.     /**
  62.      * @var \DateTime
  63.      *
  64.      * @ORM\Column(name="deleted_at", type="datetime", nullable=true)
  65.      */
  66.     private $deletedAt;
  67.     /**
  68.      * @var int
  69.      * @ORM\Column(name="created_uid", type="bigint" ,length=20 ,options={"unsigned"=true})
  70.      */
  71.     private $createdUid;
  72.     /**
  73.      * @var int
  74.      * @ORM\Column(name="updated_uid", type="bigint" ,length=20 ,options={"unsigned"=true}, nullable=true)
  75.      */
  76.     private $updatedUid;
  77.     /**
  78.      * @var int
  79.      * @ORM\Column(name="deleted_uid", type="bigint" ,length=20 ,options={"unsigned"=true}, nullable=true)
  80.      */
  81.     private $deletedUid;
  82.     /**
  83.      * @var \integer
  84.      *
  85.      * @ORM\Column(name="instance_id", type="integer",length=11,nullable=true)
  86.      */
  87.     private $instanceId;
  88.     /**
  89.      * @var \string
  90.      *
  91.      * @ORM\Column(name="instance_type", type="string",length=255,nullable=true)
  92.      */
  93.     private $instanceType;
  94.     /**
  95.      * Set id.
  96.      *
  97.      * @param int $id
  98.      *
  99.      * @return ServiceRuleMaster
  100.      */
  101.     public function setId($id)
  102.     {
  103.         $this->id $id;
  104.         return $this;
  105.     }
  106.     /**
  107.      * Get id.
  108.      *
  109.      * @return int
  110.      */
  111.     public function getId()
  112.     {
  113.         return $this->id;
  114.     }
  115.     /**
  116.      * Set ruleName.
  117.      *
  118.      * @param string $ruleName
  119.      *
  120.      * @return ServiceRuleMaster
  121.      */
  122.     public function setRuleName($ruleName)
  123.     {
  124.         $this->ruleName $ruleName;
  125.         return $this;
  126.     }
  127.     /**
  128.      * Get ruleName.
  129.      *
  130.      * @return string
  131.      */
  132.     public function getRuleName()
  133.     {
  134.         return $this->ruleName;
  135.     }
  136.     /**
  137.      * Set ruleType.
  138.      *
  139.      * @param string $ruleType
  140.      *
  141.      * @return ServiceRuleMaster
  142.      */
  143.     public function setRuleType($ruleType)
  144.     {
  145.         $this->ruleType $ruleType;
  146.         return $this;
  147.     }
  148.     /**
  149.      * Get ruleType.
  150.      *
  151.      * @return string
  152.      */
  153.     public function getRuleType()
  154.     {
  155.         return $this->ruleType;
  156.     }
  157.     /**
  158.      * Set status.
  159.      *
  160.      * @param int $status
  161.      *
  162.      * @return ServiceRuleMaster
  163.      */
  164.     public function setStatus($status)
  165.     {
  166.         $this->status = ($status === null $status);
  167.         return $this;
  168.     }
  169.     /**
  170.      * Get status.
  171.      *
  172.      * @return int
  173.      */
  174.     public function getStatus()
  175.     {
  176.         return $this->status;
  177.     }
  178.     /**
  179.      * Set countryId.
  180.      *
  181.      * @param int $countryId
  182.      *
  183.      * @return ServiceRuleMaster
  184.      */
  185.     public function setCountryId($countryId)
  186.     {
  187.         $this->countryId $countryId;
  188.         return $this;
  189.     }
  190.     /**
  191.      * Get countryId.
  192.      *
  193.      * @return int
  194.      */
  195.     public function getCountryId()
  196.     {
  197.         return $this->countryId;
  198.     }
  199.     /**
  200.      * Set createdAt.
  201.      *
  202.      * @param \DateTime $createdAt
  203.      *
  204.      * @return ServiceRuleMaster
  205.      */
  206.     public function setCreatedAt(\DateTime $createdAt null)
  207.     {
  208.         $this->createdAt = ($createdAt === null) ? new \DateTime() : $createdAt;
  209.         return $this;
  210.     }
  211.     /**
  212.      * Get createdAt.
  213.      *
  214.      * @return \DateTime
  215.      */
  216.     public function getCreatedAt()
  217.     {
  218.         return $this->createdAt;
  219.     }
  220.     /**
  221.      * Set updatedAt.
  222.      *
  223.      * @param \DateTime $updatedAt
  224.      *
  225.      * @return ServiceRuleMaster
  226.      */
  227.     public function setUpdatedAt(\DateTime $updatedAt null)
  228.     {
  229.         $this->updatedAt = ($updatedAt === null) ? new \DateTime() : $updatedAt;
  230.         return $this;
  231.     }
  232.     /**
  233.      * Get updatedAt.
  234.      *
  235.      * @return \DateTime
  236.      */
  237.     public function getUpdatedAt()
  238.     {
  239.         return $this->updatedAt;
  240.     }
  241.     /**
  242.      * Set deletedAt.
  243.      *
  244.      * @param \DateTime $deletedAt
  245.      *
  246.      * @return ServiceRuleMaster
  247.      */
  248.     public function setDeletedAt(\DateTime $deletedAt null)
  249.     {
  250.         $this->deletedAt = ($deletedAt === null) ? new \DateTime() : $deletedAt;
  251.         return $this;
  252.     }
  253.     /**
  254.      * Get deletedAt.
  255.      *
  256.      * @return \DateTime
  257.      */
  258.     public function getDeletedAt()
  259.     {
  260.         return $this->deletedAt;
  261.     }
  262.     /**
  263.      * Set createdUid.
  264.      *
  265.      * @param int $createdUid
  266.      *
  267.      * @return ServiceGroup
  268.      */
  269.     public function setCreatedUid($createdUid)
  270.     {
  271.         $this->createdUid $createdUid;
  272.         return $this;
  273.     }
  274.     /**
  275.      * Get createdUid.
  276.      *
  277.      * @return int
  278.      */
  279.     public function getCreatedUid()
  280.     {
  281.         return $this->createdUid;
  282.     }
  283.     /**
  284.      * Set updatedUid.
  285.      *
  286.      * @param int $updatedUid
  287.      *
  288.      * @return ServiceGroup
  289.      */
  290.     public function setUpdatedUid($updatedUid)
  291.     {
  292.         $this->updatedUid $updatedUid;
  293.         return $this;
  294.     }
  295.     /**
  296.      * Get updatedUid.
  297.      *
  298.      * @return int
  299.      */
  300.     public function getUpdatedUid()
  301.     {
  302.         return $this->updatedUid;
  303.     }
  304.     /**
  305.      * Set deletedUid.
  306.      *
  307.      * @param int $deletedUid
  308.      *
  309.      * @return ServiceGroup
  310.      */
  311.     public function setDeletedUid($deletedUid)
  312.     {
  313.         $this->deletedUid $deletedUid;
  314.         return $this;
  315.     }
  316.     /**
  317.      * Get deletedUid.
  318.      *
  319.      * @return int
  320.      */
  321.     public function getDeletedUid()
  322.     {
  323.         return $this->deletedUid;
  324.     }
  325.     /**
  326.      * Set instanceId.
  327.      *
  328.      * @param int $instanceId
  329.      *
  330.      * @return Coupon
  331.      */
  332.     public function setInstanceId($instanceId)
  333.     {
  334.         $this->instanceId $instanceId;
  335.         return $this;
  336.     }
  337.     /**
  338.      * Get instanceId.
  339.      *
  340.      * @return int
  341.      */
  342.     public function getInstanceId()
  343.     {
  344.         return $this->instanceId;
  345.     }
  346.     /**
  347.      * Set instanceType.
  348.      *
  349.      * @param string $instanceType
  350.      *
  351.      * @return Coupon
  352.      */
  353.     public function setInstanceType($instanceType)
  354.     {
  355.         $this->instanceType $instanceType;
  356.         return $this;
  357.     }
  358.     /**
  359.      * Get instanceType.
  360.      *
  361.      * @return string
  362.      */
  363.     public function getInstanceType()
  364.     {
  365.         return $this->instanceType;
  366.     }
  367.     public function __construct()
  368.     {
  369.         $this->serviceRuleMainConditionId = new \Doctrine\Common\Collections\ArrayCollection();
  370.     }
  371.     public function addServiceRuleMainConditionId(ServiceRuleMainCondition $serviceRuleMainConditionId)
  372.     {
  373.         $this->serviceRuleMainConditionId->add($serviceRuleMainConditionId);
  374.         return $this;
  375.     }
  376.     public function removeServiceRuleMainConditionId(ServiceRuleMainCondition $serviceRuleMainConditionId)
  377.     {
  378.         $this->serviceRuleMainConditionId->removeElement($serviceRuleMainConditionId);
  379.         return $this;
  380.     }
  381.     public function getServiceRuleMainConditionId()
  382.     {
  383.         return $this->serviceRuleMainConditionId;
  384.     }
  385.     /**
  386.      * Make clone object with child entity.
  387.      *
  388.      * @return string
  389.      */
  390.     public function __clone()
  391.     {
  392.         $ruleMainConditionArray $this->getServiceRuleMainConditionId();
  393.         if ($ruleMainConditionArray) {
  394.             $this->serviceRuleMainConditionId = new \Doctrine\Common\Collections\ArrayCollection();
  395.             foreach ($ruleMainConditionArray as $ruleMainCondition) {
  396.                 $copyRuleMainCondition = clone $ruleMainCondition;
  397.                 $copyRuleMainCondition->setId(null);
  398.                 $copyRuleMainCondition->setServiceRuleMasterId($this);
  399.                 $this->addServiceRuleMainConditionId($copyRuleMainCondition);
  400.             }
  401.         }
  402.     }
  403. }