src/OfficeBrain/Bundle/AccessManagementBundle/Entity/InstanceMaster.php line 24

Open in your IDE?
  1. <?php
  2. namespace App\OfficeBrain\Bundle\AccessManagementBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. /**
  6.  * Entity For InstanceMaster
  7.  *
  8.  * Define Instance Master
  9.  *
  10.  * @author OfficeBrain 4273 <info@officebrain.com>
  11.  *
  12.  */
  13. /**
  14.  * InstanceMaster
  15.  *
  16.  * @ORM\Table(name="tbl_instance_master", options={"type"="InnoDB","charset"="utf8","collate"="utf8_unicode_ci"})
  17.  * @ORM\Entity(repositoryClass="App\OfficeBrain\Bundle\AccessManagementBundle\Entity\InstanceMasterRepository")
  18.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
  19.  */
  20. class InstanceMaster
  21. {
  22.     /**
  23.      * @var integer
  24.      *
  25.      * @ORM\Column(name="id", type="bigint", length=20, options={"unsigned"=true})
  26.      * @ORM\Id
  27.      * @ORM\GeneratedValue(strategy="AUTO")
  28.      */
  29.     private $id;
  30.     /**
  31.      * @var string
  32.      *
  33.      * @ORM\Column(name="instance_type", type="string", length=255, columnDefinition="enum('association','supplier','distributor','sub_shop')", options={"collate"="utf8_unicode_ci"})
  34.      */
  35.     protected $instanceType;
  36.     /**
  37.      * @var string
  38.      *
  39.      * @ORM\Column(name="domain", type="string", length=255, options={"collate"="utf8_unicode_ci"})
  40.      */
  41.     protected $domain;
  42.     /**
  43.      * @var integer
  44.      *
  45.      * @ORM\Column(name="owner_id", type="bigint", length=20, options={"unsigned"=true})
  46.      */
  47.     protected $ownerId;
  48.     /**
  49.      * Bidirectional (OWNING SIDE - FK)
  50.      *
  51.      * @ORM\ManyToOne(targetEntity="\App\OfficeBrain\Bundle\ThemeBundle\Entity\ThemeMaster", inversedBy="theme")
  52.      * @ORM\JoinColumn(nullable=false)
  53.      */
  54.     protected $theme;
  55.     /**
  56.      *
  57.      * @ORM\OneToMany(targetEntity="\App\OfficeBrain\Bundle\AccessManagementBundle\Entity\InstanceAccessMapping", mappedBy="instance")
  58.      * @ORM\JoinColumn(nullable=false)
  59.      */
  60.     protected $instance;
  61.     /**
  62.      *
  63.      * @ORM\Column(name="is_main", type="integer", length=2, options={"unsigned"=true,"default" = 0})
  64.      */
  65.     protected $isMain;
  66.     /**
  67.      * @var datetime
  68.      *
  69.      * @Gedmo\Timestampable(on="create")
  70.      * @ORM\Column(type="datetime", name="created_at")
  71.      */
  72.     protected $createdAt;
  73.     /**
  74.      * @var \DateTime
  75.      *
  76.      * @Gedmo\Timestampable(on="update")
  77.      * @ORM\Column(type="datetime", name="updated_at", nullable=true)
  78.      */
  79.     protected $updatedAt;
  80.     /**
  81.      * @var \DateTime
  82.      *
  83.      * @ORM\Column(type="datetime", name="deleted_at", nullable=true)
  84.      */
  85.     protected $deletedAt;
  86.     /**
  87.      *
  88.      * @ORM\Column(name="status", type="integer", length=10, options={"unsigned"=true,"default" = 1})
  89.      */
  90.     protected $status;
  91.     /**
  92.      * Get id
  93.      *
  94.      * @return integer
  95.      */
  96.     public function getId()
  97.     {
  98.         return $this->id;
  99.     }
  100.     /**
  101.      * Set instanceType
  102.      *
  103.      * @param string $instanceType
  104.      * @return InstanceMaster
  105.      */
  106.     public function setInstanceType($instanceType)
  107.     {
  108.         $this->instanceType $instanceType;
  109.         return $this;
  110.     }
  111.     /**
  112.      * Get instanceType
  113.      *
  114.      * @return string
  115.      */
  116.     public function getInstanceType()
  117.     {
  118.         return $this->instanceType;
  119.     }
  120.     /**
  121.      * Set domain
  122.      *
  123.      * @param string $domain
  124.      * @return InstanceMaster
  125.      */
  126.     public function setDomain($domain)
  127.     {
  128.         $this->domain $domain;
  129.         return $this;
  130.     }
  131.     /**
  132.      * Get domain
  133.      *
  134.      * @return string
  135.      */
  136.     public function getDomain()
  137.     {
  138.         return $this->domain;
  139.     }
  140.     /**
  141.      * Set ownerId
  142.      *
  143.      * @param integer $ownerId
  144.      * @return InstanceMaster
  145.      */
  146.     public function setOwnerId($ownerId)
  147.     {
  148.         $this->ownerId $ownerId;
  149.         return $this;
  150.     }
  151.     /**
  152.      * Get ownerId
  153.      *
  154.      * @return integer
  155.      */
  156.     public function getOwnerId()
  157.     {
  158.         return $this->ownerId;
  159.     }
  160.     /**
  161.      * Set theme
  162.      *
  163.      * @param \App\OfficeBrain\Bundle\ThemeBundle\Entity\ThemeMaster $theme
  164.      * @return InstanceMaster
  165.      */
  166.     public function setTheme(\App\OfficeBrain\Bundle\ThemeBundle\Entity\ThemeMaster $theme)
  167.     {
  168.         $this->theme $theme;
  169.         return $this;
  170.     }
  171.     /**
  172.      * Get theme
  173.      *
  174.      * @return \App\OfficeBrain\Bundle\ThemeBundle\Entity\ThemeMaster
  175.      */
  176.     public function getTheme()
  177.     {
  178.         return $this->theme;
  179.     }
  180.     /**
  181.      * Set createdAt
  182.      *
  183.      * @param \DateTime $createdAt
  184.      * @return InstanceMaster
  185.      */
  186.     public function setCreatedAt($createdAt)
  187.     {
  188.         $this->createdAt $createdAt;
  189.         return $this;
  190.     }
  191.     /**
  192.      * Get createdAt
  193.      *
  194.      * @return \DateTime
  195.      */
  196.     public function getCreatedAt()
  197.     {
  198.         return $this->createdAt;
  199.     }
  200.     /**
  201.      * Set updatedAt
  202.      *
  203.      * @param \DateTime $updatedAt
  204.      * @return InstanceMaster
  205.      */
  206.     public function setUpdatedAt($updatedAt)
  207.     {
  208.         $this->updatedAt $updatedAt;
  209.         return $this;
  210.     }
  211.     /**
  212.      * Get updatedAt
  213.      *
  214.      * @return \DateTime
  215.      */
  216.     public function getUpdatedAt()
  217.     {
  218.         return $this->updatedAt;
  219.     }
  220.     /**
  221.      * Set deletedAt
  222.      *
  223.      * @param \DateTime $deletedAt
  224.      * @return InstanceMaster
  225.      */
  226.     public function setDeletedAt($deletedAt)
  227.     {
  228.         $this->deletedAt $deletedAt;
  229.         return $this;
  230.     }
  231.     /**
  232.      * Get deletedAt
  233.      *
  234.      * @return \DateTime
  235.      */
  236.     public function getDeletedAt()
  237.     {
  238.         return $this->deletedAt;
  239.     }
  240.     /**
  241.      * Constructor
  242.      */
  243.     public function __construct()
  244.     {
  245.         $this->instance = new \Doctrine\Common\Collections\ArrayCollection();
  246.     }
  247.     /**
  248.      * Add instance
  249.      *
  250.      * @param \App\OfficeBrain\Bundle\AccessManagementBundle\Entity\InstanceAccessMapping $instance
  251.      * @return InstanceMaster
  252.      */
  253.     public function addInstance(\App\OfficeBrain\Bundle\AccessManagementBundle\Entity\InstanceAccessMapping $instance)
  254.     {
  255.         $this->instance[] = $instance;
  256.         return $this;
  257.     }
  258.     /**
  259.      * Remove instance
  260.      *
  261.      * @param \App\OfficeBrain\Bundle\AccessManagementBundle\Entity\InstanceAccessMapping $instance
  262.      */
  263.     public function removeInstance(\App\OfficeBrain\Bundle\AccessManagementBundle\Entity\InstanceAccessMapping $instance)
  264.     {
  265.         $this->instance->removeElement($instance);
  266.     }
  267.     /**
  268.      * Get instance
  269.      *
  270.      * @return \Doctrine\Common\Collections\Collection
  271.      */
  272.     public function getInstance()
  273.     {
  274.         return $this->instance;
  275.     }
  276.     
  277.     /**
  278.      * Set Is Main Instance
  279.      *
  280.      * @param integer $isMain
  281.      * @return InstanceMaster
  282.      */
  283.     public function setIsMain($isMain)
  284.     {
  285.         $this->isMain $isMain;
  286.         return $this;
  287.     }
  288.     /**
  289.      * Get Is Main Instance Flag
  290.      *
  291.      * @return integer
  292.      */
  293.     public function getIsMain()
  294.     {
  295.         return $this->isMain;
  296.     }
  297.     /**
  298.      * Set status
  299.      *
  300.      * @param integer $status
  301.      * @return InstanceMaster
  302.      */
  303.     public function setStatus($status)
  304.     {
  305.         $this->status $status;
  306.         return $this;
  307.     }
  308.     /**
  309.      * Get status
  310.      *
  311.      * @return integer 
  312.      */
  313.     public function getStatus()
  314.     {
  315.         return $this->status;
  316.     }
  317. }