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 1
1
2
- /**
3
- * @return {{ AttributeType }}
4
- */
5
2
public function get{{ GetterName }}(): {{ AttributeType }}
6
3
{
7
4
return $this->{{ AttributeName }};
8
5
}
9
6
10
- /**
11
- * @param {{ AttributeType }} ${{ AttributeName }}
12
- */
13
7
public function set{{ SetterName }}({{ AttributeType }} ${{ AttributeName }}): void
14
8
{
15
9
$this->{{ AttributeName }} = ${{ AttributeName }};
Original file line number Diff line number Diff line change @@ -7,11 +7,7 @@ use Nanvaie\DatabaseRepository\Models\Factories\Factory;
7
7
use stdClass;
8
8
9
9
class {{ FactoryName }} extends Factory
10
- {
11
- /**
12
- * @param stdClass $entity
13
- * @return {{ EntityName }}
14
- */
10
+ {
15
11
public function makeEntityFromStdClass(stdClass $entity): {{ EntityName }}
16
12
{
17
13
${{ EntityVariableName }} = new {{ EntityName }}();
Original file line number Diff line number Diff line change 1
1
2
- /**
3
- * @param {{ EntityName }} ${{ EntityVariableName }}
4
- * @return {{ EntityName }}
5
- */
6
2
public function create({{ EntityName }} ${{ EntityVariableName }}): {{ EntityName }}
7
3
{
8
4
{{ SetterFunctions }}
Original file line number Diff line number Diff line change 1
1
2
- /**
3
- * @param {{ EntityName }} ${{ EntityVariableName }}
4
- * @return int
5
- */
6
2
public function remove({{ EntityName }} ${{ EntityVariableName }}): int
7
3
{
8
4
return $this->newQuery()
11
7
'deleted_at' => date('Y-m-d H:i:s'),
12
8
]);
13
9
}
14
-
15
- /**
16
- * @param {{ EntityName }} ${{ EntityVariableName }}
17
- * @return int
18
- */
10
+
19
11
public function restore({{ EntityName }} ${{ EntityVariableName }}): int
20
12
{
21
13
return $this->newQuery()
Original file line number Diff line number Diff line change 1
1
2
- /**
3
- * @param array ${{ AttributeNamePlural }}
4
- * @return Collection
5
- */
6
2
public function getAllBy{{ FunctionNamePlural }}(array ${{ AttributeNamePlural }}): Collection
7
3
{
8
4
${{ EntityVariableName }} = $this->newQuery()
Original file line number Diff line number Diff line change 1
1
2
- /**
3
- * @param int ${{ AttributeName }}
4
- * @return {{ EntityName }}|null
5
- */
6
2
public function getOneBy{{ FunctionName }}(int ${{ AttributeName }}): null|{{ EntityName }}
7
3
{
8
4
${{ EntityVariableName }} = $this->newQuery()
Original file line number Diff line number Diff line change 1
1
2
- /**
3
- * @param {{ EntityName }} ${{ EntityVariableName }}
4
- * @return int
5
- */
6
2
public function update({{ EntityName }} ${{ EntityVariableName }}): int
7
3
{
8
4
{{ UpdateFieldSetter }}
Original file line number Diff line number Diff line change @@ -9,21 +9,13 @@ use Nanvaie\DatabaseRepository\Models\Resources\Resource;
9
9
10
10
class {{ ResourceName }} extends Resource
11
11
{
12
- /**
13
- * @param Entity|{{ EntityName }} ${{ EntityVariableName }}
14
- * @return array
15
- */
16
12
public function toArray(${{ EntityVariableName }}): array
17
13
{
18
14
return [
19
15
{{ GetterFunctions }}
20
16
];
21
17
}
22
18
23
- /**
24
- * @param Entity|{{ EntityName }} ${{ EntityVariableName }}
25
- * @return array
26
- */
27
19
public function toArrayWithForeignKeys(${{ EntityVariableName }}): array
28
20
{
29
21
return $this->toArray(${{ EntityVariableName }}) + [
You can’t perform that action at this time.
0 commit comments