File tree Expand file tree Collapse file tree 8 files changed +2
-44
lines changed Expand file tree Collapse file tree 8 files changed +2
-44
lines changed Original file line number Diff line number Diff line change 11
2- /**
3- * @return {{ AttributeType }}
4- */
52 public function get{{ GetterName }}(): {{ AttributeType }}
63 {
74 return $this->{{ AttributeName }};
85 }
96
10- /**
11- * @param {{ AttributeType }} ${{ AttributeName }}
12- */
137 public function set{{ SetterName }}({{ AttributeType }} ${{ AttributeName }}): void
148 {
159 $this->{{ AttributeName }} = ${{ AttributeName }};
Original file line number Diff line number Diff line change @@ -7,11 +7,7 @@ use Nanvaie\DatabaseRepository\Models\Factories\Factory;
77use stdClass;
88
99class {{ FactoryName }} extends Factory
10- {
11- /**
12- * @param stdClass $entity
13- * @return {{ EntityName }}
14- */
10+ {
1511 public function makeEntityFromStdClass(stdClass $entity): {{ EntityName }}
1612 {
1713 ${{ EntityVariableName }} = new {{ EntityName }}();
Original file line number Diff line number Diff line change 11
2- /**
3- * @param {{ EntityName }} ${{ EntityVariableName }}
4- * @return {{ EntityName }}
5- */
62 public function create({{ EntityName }} ${{ EntityVariableName }}): {{ EntityName }}
73 {
84{{ SetterFunctions }}
Original file line number Diff line number Diff line change 11
2- /**
3- * @param {{ EntityName }} ${{ EntityVariableName }}
4- * @return int
5- */
62 public function remove({{ EntityName }} ${{ EntityVariableName }}): int
73 {
84 return $this->newQuery()
117 'deleted_at' => date('Y-m-d H:i:s'),
128 ]);
139 }
14-
15- /**
16- * @param {{ EntityName }} ${{ EntityVariableName }}
17- * @return int
18- */
10+
1911 public function restore({{ EntityName }} ${{ EntityVariableName }}): int
2012 {
2113 return $this->newQuery()
Original file line number Diff line number Diff line change 11
2- /**
3- * @param array ${{ AttributeNamePlural }}
4- * @return Collection
5- */
62 public function getAllBy{{ FunctionNamePlural }}(array ${{ AttributeNamePlural }}): Collection
73 {
84 ${{ EntityVariableName }} = $this->newQuery()
Original file line number Diff line number Diff line change 11
2- /**
3- * @param int ${{ AttributeName }}
4- * @return {{ EntityName }}|null
5- */
62 public function getOneBy{{ FunctionName }}(int ${{ AttributeName }}): null|{{ EntityName }}
73 {
84 ${{ EntityVariableName }} = $this->newQuery()
Original file line number Diff line number Diff line change 11
2- /**
3- * @param {{ EntityName }} ${{ EntityVariableName }}
4- * @return int
5- */
62 public function update({{ EntityName }} ${{ EntityVariableName }}): int
73 {
84{{ UpdateFieldSetter }}
Original file line number Diff line number Diff line change @@ -9,21 +9,13 @@ use Nanvaie\DatabaseRepository\Models\Resources\Resource;
99
1010class {{ ResourceName }} extends Resource
1111{
12- /**
13- * @param Entity|{{ EntityName }} ${{ EntityVariableName }}
14- * @return array
15- */
1612 public function toArray(${{ EntityVariableName }}): array
1713 {
1814 return [
1915{{ GetterFunctions }}
2016 ];
2117 }
2218
23- /**
24- * @param Entity|{{ EntityName }} ${{ EntityVariableName }}
25- * @return array
26- */
2719 public function toArrayWithForeignKeys(${{ EntityVariableName }}): array
2820 {
2921 return $this->toArray(${{ EntityVariableName }}) + [
You can’t perform that action at this time.
0 commit comments