vendor/dachcom-digital/members/src/MembersBundle/Restriction/Restriction.php line 30

Open in your IDE?
  1. <?php
  2. namespace MembersBundle\Restriction;
  3. use Pimcore\Model\AbstractModel;
  4. /**
  5.  * @method \MembersBundle\Restriction\Dao getDao()
  6.  */
  7. class Restriction extends AbstractModel
  8. {
  9.     public ?int $id null;
  10.     public ?string $ctype null;
  11.     public int $targetId 0;
  12.     public bool $isInherited false;
  13.     public bool $inherit false;
  14.     public array $relatedGroups = [];
  15.     public static function getById(int $id): Restriction
  16.     {
  17.         $obj = new self();
  18.         $obj->getDao()->getById($id);
  19.         return $obj;
  20.     }
  21.     public static function getByTargetId(int $idstring $cType 'page'): Restriction
  22.     {
  23.         $obj = new self();
  24.         $obj->getDao()->getByField('targetId'$id$cType);
  25.         return $obj;
  26.     }
  27.     public function getId(): ?int
  28.     {
  29.         return $this->id;
  30.     }
  31.     public function setId(int $id): self
  32.     {
  33.         $this->id $id;
  34.         return $this;
  35.     }
  36.     public function getCtype(): ?string
  37.     {
  38.         return $this->ctype;
  39.     }
  40.     public function setCtype(string $cType): self
  41.     {
  42.         $this->ctype $cType;
  43.         return $this;
  44.     }
  45.     public function getTargetId(): int
  46.     {
  47.         return $this->targetId;
  48.     }
  49.     public function setTargetId(int $targetId): self
  50.     {
  51.         $this->targetId $targetId;
  52.         return $this;
  53.     }
  54.     public function getRelatedGroups(): array
  55.     {
  56.         return $this->relatedGroups;
  57.     }
  58.     public function setRelatedGroups(array $relatedGroups): self
  59.     {
  60.         $this->relatedGroups array_map('intval'$relatedGroups);
  61.         return $this;
  62.     }
  63.     public function isInherited(): bool
  64.     {
  65.         return $this->getIsInherited();
  66.     }
  67.     public function getIsInherited(): bool
  68.     {
  69.         return $this->isInherited;
  70.     }
  71.     public function setIsInherited(bool $isInherited): self
  72.     {
  73.         $this->isInherited $isInherited;
  74.         return $this;
  75.     }
  76.     public function getInherit(): bool
  77.     {
  78.         return $this->inherit;
  79.     }
  80.     public function setInherit(bool $inherit): self
  81.     {
  82.         $this->inherit $inherit;
  83.         return $this;
  84.     }
  85. }