migrate notes
This commit is contained in:
@@ -29,7 +29,7 @@ class GuiController extends AbstractController {
|
||||
public function notes(
|
||||
EntityManagerInterface $entityManager,
|
||||
): array {
|
||||
$notes = $entityManager->getRepository(Note::class)->findAll();
|
||||
$notes = $entityManager->getRepository(Note::class)->findAllOrderedBySlugDesc();
|
||||
|
||||
return [
|
||||
'title' => 'Joe Carstairs\' notes',
|
||||
|
||||
@@ -30,28 +30,14 @@ class NoteRepository extends ServiceEntityRepository
|
||||
return count($wherePublishedOnDate);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Note[] Returns an array of Note objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('n')
|
||||
// ->andWhere('n.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('n.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Note
|
||||
// {
|
||||
// return $this->createQueryBuilder('n')
|
||||
// ->andWhere('n.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
/**
|
||||
* @return Note[] Returns an array of Note objects
|
||||
*/
|
||||
public function findAllOrderedBySlugDesc(): array
|
||||
{
|
||||
return $this->createQueryBuilder('n')
|
||||
->orderBy('n.slug', 'DESC')
|
||||
->getQuery()
|
||||
->getResult();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user