DoDomuDojade Documentation

AnnouncementRepositoryInterface

Describes behavior of the announcement repository

Table of Contents

Methods

add()  : AnnouncementId
Adds an announcement
delete()  : int
Deletes an announcement with provided ID.
deleteRejectedOlderThan()  : int
Deletes rejected announcements older than the specified date.
findAll()  : array<string|int, Announcement>
Returns all announcements
findById()  : Announcement|null
Returns an announcement with provided id (if found)
findByTitle()  : array<string|int, Announcement>
Returns all announcement with similar title
findPending()  : array<string|int, Announcement>
Returns all announcements that have pending status
findValid()  : array<string|int, Announcement>
Returns all announcements that are valid on condition that <li> announcement valid date is valid today</li> <li> announcement is approved </li>
update()  : int
Updates an announcement.

Methods

deleteRejectedOlderThan()

Deletes rejected announcements older than the specified date.

public deleteRejectedOlderThan(DateTimeImmutable $date) : int
Parameters
$date : DateTimeImmutable
Tags
throws
Exception
Return values
int

Number of deleted rows

findValid()

Returns all announcements that are valid on condition that <li> announcement valid date is valid today</li> <li> announcement is approved </li>

public findValid() : array<string|int, Announcement>
Tags
throws
Exception
Return values
array<string|int, Announcement>

        
On this page

Search results