Skip to content

Commit d2707c0

Browse files
committed
Create MySql Stubs for PHP 7.0 and 8.0
1 parent 1e7bedf commit d2707c0

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
/**
3+
* @param array ${{ AttributeNamePlural }}
4+
* @return Collection
5+
*/
6+
public function getAllBy{{ FunctionNamePlural }}(${{ AttributeNamePlural }})
7+
{
8+
${{ EntityVariableName }} = $this->newQuery()
9+
->whereIn('{{ AttributeName }}', ${{ AttributeNamePlural }})
10+
->get();
11+
12+
return $this->factory->makeCollectionOfEntities(${{ EntityVariableName }});
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
/**
3+
* @param {{ AttributeType }} ${{ AttributeName }}
4+
* @return {{ EntityName }}|null
5+
*/
6+
public function getOneBy{{ FunctionName }}(${{ AttributeName }})
7+
{
8+
${{ EntityVariableName }} = $this->newQuery()
9+
->where('{{ AttributeName }}', ${{ AttributeName }})
10+
->first();
11+
12+
return ${{ EntityVariableName }} ? $this->factory->makeEntityFromStdClass(${{ EntityVariableName }}) : null;
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
/**
3+
* @param array ${{ AttributeNamePlural }}
4+
* @return Collection
5+
*/
6+
public function getAllBy{{ FunctionNamePlural }}(array ${{ AttributeNamePlural }}): Collection
7+
{
8+
${{ EntityVariableName }} = $this->newQuery()
9+
->whereIn('{{ AttributeName }}', ${{ AttributeNamePlural }})
10+
->get();
11+
12+
return $this->factory->makeCollectionOfEntities(${{ EntityVariableName }});
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
/**
3+
* @param {{ AttributeType }} ${{ AttributeName }}
4+
* @return {{ EntityName }}|null
5+
*/
6+
public function getOneBy{{ FunctionName }}({{ AttributeType }} ${{ AttributeName }}): ?{{ EntityName }}
7+
{
8+
${{ EntityVariableName }} = $this->newQuery()
9+
->where('{{ AttributeName }}', ${{ AttributeName }})
10+
->first();
11+
12+
return ${{ EntityVariableName }} ? $this->factory->makeEntityFromStdClass(${{ EntityVariableName }}) : null;
13+
}

0 commit comments

Comments
 (0)