Просмотр исходного кода

AbstractRepositoryQuery : ajout setOrderBy()

feature/symfony6.1
Guillaume Bourgeois 1 год назад
Родитель
Сommit
0b2448b3d8
1 измененных файлов: 6 добавлений и 1 удалений
  1. +6
    -1
      Repository/AbstractRepositoryQuery.php

+ 6
- 1
Repository/AbstractRepositoryQuery.php Просмотреть файл

return $this; return $this;
}*/ }*/


// @TODO : créer un addOrderBy et un orderBy
public function orderBy(string $field, string $sort = 'ASC'): self public function orderBy(string $field, string $sort = 'ASC'): self
{ {
if (strpos($field, '.')!==false) { if (strpos($field, '.')!==false) {
} }
} }


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

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

Загрузка…
Отмена
Сохранить