Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pixel Humain
GoGoCarto
Commits
58cccbed
Commit
58cccbed
authored
May 04, 2021
by
Sebastian Castro
Browse files
newsletter: fix testing email
parent
6bcb10af
Changes
1
Show whitespace changes
Inline
Side-by-side
src/Repository/NewsRepository.php
View file @
58cccbed
...
...
@@ -9,14 +9,14 @@ use Doctrine\ODM\MongoDB\Repository\DocumentRepository;
final
class
NewsRepository
extends
DocumentRepository
{
public
function
findLastPublishedNews
(
\
DateTime
$lastNewsletterSentAt
)
public
function
findLastPublishedNews
(
$lastNewsletterSentAt
)
{
return
$this
->
createQueryBuilder
()
$qb
=
$this
->
createQueryBuilder
()
->
field
(
'status'
)
->
equals
(
NewsStatus
::
PUBLISHED
)
->
sort
(
'publicationDate'
,
'desc'
)
->
field
(
'publicationDate'
)
->
lte
(
new
\
DateTime
())
->
field
(
'publicationDate'
)
->
gte
(
$lastNewsletterSentAt
)
->
getQuery
()
->
execute
();
->
field
(
'publicationDate'
)
->
lte
(
new
\
DateTime
())
;
if
(
$lastNewsletterSentAt
!==
null
)
$qb
->
field
(
'publicationDate'
)
->
gte
(
$lastNewsletterSentAt
);
return
$qb
->
getQuery
()
->
execute
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment