src/Entity/UserGroupModule.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Knp\DoctrineBehaviors\Contract\Entity\SoftDeletableInterface;
  4. use Knp\DoctrineBehaviors\Model\SoftDeletable\SoftDeletableTrait;
  5. use Knp\DoctrineBehaviors\Model\Blameable\BlameableTrait;
  6. use Knp\DoctrineBehaviors\Contract\Entity\BlameableInterface;
  7. use Knp\DoctrineBehaviors\Model\Timestampable\TimestampableTrait;
  8. use Knp\DoctrineBehaviors\Contract\Entity\TimestampableInterface;
  9. /**
  10.  * @Doctrine\ORM\Mapping\Entity
  11.  * @Doctrine\ORM\Mapping\Table(name="user_groups_module")
  12.  */
  13. class UserGroupModule implements BlameableInterfaceTimestampableInterfaceSoftDeletableInterface  {
  14.     use BlameableTrait;
  15.     use TimestampableTrait;
  16.     
  17.     use SoftDeletableTrait;
  18.     
  19. const EDIT 1;
  20.     const EDIT_ALL 2;
  21.     /**
  22.      * @Doctrine\ORM\Mapping\Id
  23.      * @Doctrine\ORM\Mapping\Column(type="integer")
  24.      * @Doctrine\ORM\Mapping\GeneratedValue(strategy="AUTO")
  25.      */
  26.     protected $id;
  27.     /**
  28.      * @Doctrine\ORM\Mapping\ManyToOne(targetEntity="Module", inversedBy="groupsModules")
  29.      * @Doctrine\ORM\Mapping\JoinColumn(name="module_id", referencedColumnName="id")
  30.      */
  31.     protected $module;
  32.     /**
  33.      * @Doctrine\ORM\Mapping\ManyToOne(targetEntity="UserGroup", inversedBy="groupsModules")
  34.      * @Doctrine\ORM\Mapping\JoinColumn(name="group_id", referencedColumnName="id")
  35.      */
  36.     protected $group;
  37.     /**
  38.      *
  39.      * @Doctrine\ORM\Mapping\Column(type="boolean")
  40.      */
  41.     protected $viewm;
  42.     /**
  43.      *
  44.      * @Doctrine\ORM\Mapping\Column(type="boolean")
  45.      */
  46.     protected $createm;
  47.     /**
  48.      * 0 - brak możliwości edycji
  49.      * 1 - edycja tylko własnych pozycji
  50.      * 2 - edycja wszystkich pozycji
  51.      * @Doctrine\ORM\Mapping\Column(type="integer")
  52.      */
  53.     protected $editm;
  54.     public function __construct()
  55.     {
  56.         $this->viewm false;
  57.         $this->createm false;
  58.         $this->editm 0;
  59.     }
  60.     public function getId()
  61.     {
  62.         return $this->id;
  63.     }
  64.     /**
  65.      * Set viewm
  66.      *
  67.      * @param boolean $viewm
  68.      *
  69.      * @return UserGroupModule
  70.      */
  71.     public function setViewm($viewm)
  72.     {
  73.         $this->viewm $viewm;
  74.         return $this;
  75.     }
  76.     /**
  77.      * Get viewm
  78.      *
  79.      * @return boolean
  80.      */
  81.     public function getViewm()
  82.     {
  83.         return $this->viewm;
  84.     }
  85.     /**
  86.      * Set createm
  87.      *
  88.      * @param boolean $createm
  89.      *
  90.      * @return UserGroupModule
  91.      */
  92.     public function setCreatem($createm)
  93.     {
  94.         $this->createm $createm;
  95.         return $this;
  96.     }
  97.     /**
  98.      * Get createm
  99.      *
  100.      * @return boolean
  101.      */
  102.     public function getCreatem()
  103.     {
  104.         return $this->createm;
  105.     }
  106.     /**
  107.      * Set editm
  108.      *
  109.      * @param integer $editm
  110.      *
  111.      * @return UserGroupModule
  112.      */
  113.     public function setEditm($editm)
  114.     {
  115.         $this->editm $editm;
  116.         return $this;
  117.     }
  118.     /**
  119.      * Get editm
  120.      *
  121.      * @return integer
  122.      */
  123.     public function getEditm()
  124.     {
  125.         return $this->editm;
  126.     }
  127.     /**
  128.      * Set module
  129.      *
  130.      * @param \App\Entity\Module $module
  131.      *
  132.      * @return UserGroupModule
  133.      */
  134.     public function setModule(\App\Entity\Module $module null)
  135.     {
  136.         $this->module $module;
  137.         return $this;
  138.     }
  139.     /**
  140.      * Get module
  141.      *
  142.      * @return \App\Entity\Module
  143.      */
  144.     public function getModule()
  145.     {
  146.         return $this->module;
  147.     }
  148.     /**
  149.      * Set group
  150.      *
  151.      * @param \App\Entity\UserGroup $group
  152.      *
  153.      * @return UserGroupModule
  154.      */
  155.     public function setGroup(\App\Entity\UserGroup $group null)
  156.     {
  157.         $this->group $group;
  158.         return $this;
  159.     }
  160.     /**
  161.      * Get group
  162.      *
  163.      * @return \App\Entity\UserGroup
  164.      */
  165.     public function getGroup()
  166.     {
  167.         return $this->group;
  168.     }
  169. }