Browse Source

AbstractRepositoryQuery : ajout setOrderBy()

develop
Guillaume Bourgeois 2 years ago
parent
commit
0b2448b3d8
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      Repository/AbstractRepositoryQuery.php

+ 6
- 1
Repository/AbstractRepositoryQuery.php View File

@@ -131,7 +131,6 @@ abstract class AbstractRepositoryQuery implements RepositoryQueryInterface
return $this;
}*/

// @TODO : créer un addOrderBy et un orderBy
public function orderBy(string $field, string $sort = 'ASC'): self
{
if (strpos($field, '.')!==false) {
@@ -141,6 +140,12 @@ abstract class AbstractRepositoryQuery implements RepositoryQueryInterface
}
}

public function setOrderBy(string $field, string $sort = 'ASC'): self
{
$this->resetDQLParts(['orderBy']);
return $this->orderBy($field, $sort);
}

public function filterById(int $id):self
{
return $this

Loading…
Cancel
Save