From 5fe6dee6c56d36f42bb6784078e3b26fd498402e Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Sun, 18 May 2025 08:19:33 +0100 Subject: [PATCH] published_date -> publishedDate --- src/Entity/Note.php | 8 ++++---- src/Repository/NoteRepository.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Entity/Note.php b/src/Entity/Note.php index 17dac1f..f894813 100644 --- a/src/Entity/Note.php +++ b/src/Entity/Note.php @@ -18,7 +18,7 @@ class Note private ?string $content = null; #[ORM\Column(type: Types::DATE_MUTABLE)] - private ?\DateTime $published_date = null; + private ?\DateTime $publishedDate = null; #[ORM\Column(length: 255)] private ?string $slug = null; @@ -42,12 +42,12 @@ class Note public function getPublishedDate(): ?\DateTime { - return $this->published_date; + return $this->publishedDate; } - public function setPublishedDate(\DateTime $published_date): static + public function setPublishedDate(\DateTime $publishedDate): static { - $this->published_date = $published_date; + $this->publishedDate = $publishedDate; return $this; } diff --git a/src/Repository/NoteRepository.php b/src/Repository/NoteRepository.php index 2322699..2829bdf 100644 --- a/src/Repository/NoteRepository.php +++ b/src/Repository/NoteRepository.php @@ -25,8 +25,8 @@ class NoteRepository extends ServiceEntityRepository $max->add(DateInterval::createFromDateString('1 day')); $wherePublishedOnDate = $this->createQueryBuilder('n') - ->andWhere('n.published_date >= :min') - ->andWhere('n.published_date < :max') + ->andWhere('n.publishedDate >= :min') + ->andWhere('n.publishedDate < :max') ->setParameter('min', $min) ->setParameter('max', $max) ->getQuery()