Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions src/Resources/views/Generator/AssociationTemplate.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
public static function join{{ column }}(
QueryBuilder $qb,
$entityName = self::NAME,
$columnName = '{{ columnDql }}',
$entityDqlTargeted = '{{ entityDqlTargeted }}',
string $entityName = self::NAME,
string $columnName = '{{ columnDql }}',
string $entityDqlTargeted = '{{ entityDqlTargeted }}',
): QueryBuilder {
$qb->join($entityName.'.'.$columnName, $entityDqlTargeted);

Expand All @@ -11,9 +11,9 @@

public static function leftJoin{{ column }}(
QueryBuilder $qb,
$entityName = self::NAME,
$columnName = '{{ columnDql }}',
$entityDqlTargeted = '{{ entityDqlTargeted }}',
string $entityName = self::NAME,
string $columnName = '{{ columnDql }}',
string $entityDqlTargeted = '{{ entityDqlTargeted }}',
): QueryBuilder {
$qb->leftJoin($entityName.'.'.$columnName, $entityDqlTargeted);

Expand All @@ -23,10 +23,10 @@
{% if idType %}
public static function filterBy{{ column }}(
QueryBuilder $qb,
$value,
$operator = Comparison::EQ,
$entityName = self::NAME,
$columnName = '{{ columnDql }}',
mixed $value,
string $operator = Comparison::EQ,
string $entityName = self::NAME,
string $columnName = '{{ columnDql }}',
): QueryBuilder {
//get a uniq index
$index = static::getParameterIndex();
Expand Down Expand Up @@ -70,9 +70,9 @@

public static function filterIn{{ column }}(
QueryBuilder $qb,
$values,
$entityName = self::NAME,
$columnName = '{{ columnDql }}',
?array $values,
string $entityName = self::NAME,
string $columnName = '{{ columnDql }}',
): QueryBuilder {
//get a uniq index
$index = static::getParameterIndex();
Expand Down Expand Up @@ -110,9 +110,9 @@

public static function filterNotIn{{ column }}(
QueryBuilder $qb,
$values,
$entityName = self::NAME,
$columnName = '{{ columnDql }}',
?array $values,
string $entityName = self::NAME,
string $columnName = '{{ columnDql }}',
): QueryBuilder {
//get a uniq index
$index = static::getParameterIndex();
Expand Down
31 changes: 16 additions & 15 deletions src/Resources/views/Generator/ColumnTemplate.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
public static function filterBy{{ column }}(
QueryBuilder $qb,
mixed $value,
$operator = Comparison::EQ,
$entityName = self::NAME,
$columnName = '{{ columnDql }}',
string $operator = Comparison::EQ,
string $entityName = self::NAME,
string $columnName = '{{ columnDql }}',
string $columnNamePrefix = '',
string $columnNameSuffix = '',
): QueryBuilder {
Expand All @@ -14,14 +14,16 @@
operator: $operator,
value: $value,
entityName: $entityName,
columnNamePrefix: $columnNamePrefix,
columnNameSuffix: $columnNameSuffix,
);
}

public static function filterIn{{ column }}(
QueryBuilder $qb,
$value,
$entityName = self::NAME,
$columnName = '{{ columnDql }}',
mixed $value,
string $entityName = self::NAME,
string $columnName = '{{ columnDql }}',
): QueryBuilder {
if ($value === null) {
$qb->andWhere($entityName.'.'.$columnName.' IS NULL');
Expand All @@ -38,9 +40,9 @@

public static function filterNotIn{{ column }}(
QueryBuilder $qb,
$value,
$entityName = self::NAME,
$columnName = '{{ columnDql }}',
mixed $value,
string $entityName = self::NAME,
string $columnName = '{{ columnDql }}',
): QueryBuilder {
if ($value === null) {
$qb->andWhere($entityName.'.'.$columnName.' IS NOT NULL');
Expand All @@ -61,7 +63,7 @@
*/
public function findBy{{ column }}(
mixed $value,
$operator = Comparison::EQ,
string $operator = Comparison::EQ,
bool $useQueryCache = false,
?string $cacheId = null,
array $resultCacheTags = [],
Expand All @@ -79,7 +81,7 @@

public function findOneBy{{ column }}(
mixed $value,
$operator = Comparison::EQ,
string $operator = Comparison::EQ,
bool $allowNull = false,
bool $useQueryCache = false,
?string $cacheId = null,
Expand Down Expand Up @@ -107,7 +109,7 @@

public function countBy{{ column }}(
mixed $value,
$operator = Comparison::EQ,
string $operator = Comparison::EQ,
bool $useQueryCache = false,
?string $cacheId = null,
array $resultCacheTags = [],
Expand All @@ -125,7 +127,7 @@

public function existsBy{{ column }}(
mixed $value,
$operator = Comparison::EQ,
string $operator = Comparison::EQ,
bool $useQueryCache = false,
?string $cacheId = null,
array $resultCacheTags = [],
Expand All @@ -143,8 +145,7 @@

public function deleteBy{{ column }}(
mixed $value,
): void
{
): void {
$qb = $this->getDeleteQueryBuilder();
static::filterBy{{ column }}($qb, $value);

Expand Down
4 changes: 2 additions & 2 deletions src/Resources/views/Generator/TopRepositoryTemplate.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class {{ entityClassname }}Base extends {{ extendClass }}{% if useInterfaces %}

public function getQueryBuilderCount(
QueryBuilder $qb,
$entityName = self::NAME,
string $entityName = self::NAME,
bool $useQueryCache = false,
?string $cacheId = null,
array $resultCacheTags = [],
Expand All @@ -229,7 +229,7 @@ class {{ entityClassname }}Base extends {{ extendClass }}{% if useInterfaces %}
{% if idType %}

public function exists(
$entity,
mixed $entity,
bool $useQueryCache = false,
?string $cacheId = null,
array $resultCacheTags = [],
Expand Down
Loading
Loading