From 24660614c0b6d0991b0c862660a5e07475e9d8ae Mon Sep 17 00:00:00 2001 From: stollr Date: Sat, 6 Jan 2024 17:57:06 +0100 Subject: [PATCH] Added group type model, request and request builder --- src/Models/Groups/Group/GroupType.php | 138 ++++++++++++++++++ src/Models/Groups/Group/GroupTypeRequest.php | 33 +++++ .../Groups/Group/GroupTypeRequestBuilder.php | 18 +++ 3 files changed, 189 insertions(+) create mode 100644 src/Models/Groups/Group/GroupType.php create mode 100644 src/Models/Groups/Group/GroupTypeRequest.php create mode 100644 src/Models/Groups/Group/GroupTypeRequestBuilder.php diff --git a/src/Models/Groups/Group/GroupType.php b/src/Models/Groups/Group/GroupType.php new file mode 100644 index 00000000..73aa3999 --- /dev/null +++ b/src/Models/Groups/Group/GroupType.php @@ -0,0 +1,138 @@ +id = $id; + return $this; + } + + public function getAvailableForNewPerson(): ?bool + { + return $this->availableForNewPerson; + } + + public function setAvailableForNewPerson(?bool $availableForNewPerson): static + { + $this->availableForNewPerson = $availableForNewPerson; + return $this; + } + + public function getIsLeaderNecessary(): ?bool + { + return $this->isLeaderNecessary; + } + + public function setIsLeaderNecessary(?bool $isLeaderNecessary): static + { + $this->isLeaderNecessary = $isLeaderNecessary; + return $this; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(?string $name): static + { + $this->name = $name; + return $this; + } + + public function getNamePlural(): ?string + { + return $this->namePlural; + } + + public function setNamePlural(?string $namePlural): static + { + $this->namePlural = $namePlural; + return $this; + } + + public function getNamePluralTranslated(): ?string + { + return $this->namePluralTranslated; + } + + public function setNamePluralTranslated(?string $namePluralTranslated): static + { + $this->namePluralTranslated = $namePluralTranslated; + return $this; + } + + public function getNameTranslated(): ?string + { + return $this->nameTranslated; + } + + public function setNameTranslated(?string $nameTranslated): static + { + $this->nameTranslated = $nameTranslated; + return $this; + } + + public function getPermissionDepth(): ?int + { + return $this->permissionDepth; + } + + public function setPermissionDepth(?int $permissionDepth): static + { + $this->permissionDepth = $permissionDepth; + return $this; + } + + public function getShorty(): ?string + { + return $this->shorty; + } + + public function setShorty(?string $shorty): static + { + $this->shorty = $shorty; + return $this; + } + + public function getSortKey(): ?int + { + return $this->sortKey; + } + + public function setSortKey(?int $sortKey): static + { + $this->sortKey = $sortKey; + return $this; + } +} diff --git a/src/Models/Groups/Group/GroupTypeRequest.php b/src/Models/Groups/Group/GroupTypeRequest.php new file mode 100644 index 00000000..9df2ed57 --- /dev/null +++ b/src/Models/Groups/Group/GroupTypeRequest.php @@ -0,0 +1,33 @@ +all(); + } + + public static function where(string $key, $value): GroupTypeRequestBuilder + { + return (new GroupTypeRequestBuilder())->where($key, $value); + } + + public static function orderBy(string $key, $orderAscending = true): GroupTypeRequestBuilder + { + return (new GroupTypeRequestBuilder())->orderBy($key, $orderAscending); + } + + public static function findOrFail(int $id): GroupType + { + return (new GroupTypeRequestBuilder())->findOrFail($id); + } + + public static function find(int $id): ?GroupType + { + return (new GroupTypeRequestBuilder())->find($id); + } + +} diff --git a/src/Models/Groups/Group/GroupTypeRequestBuilder.php b/src/Models/Groups/Group/GroupTypeRequestBuilder.php new file mode 100644 index 00000000..d64e3694 --- /dev/null +++ b/src/Models/Groups/Group/GroupTypeRequestBuilder.php @@ -0,0 +1,18 @@ +