DoDomuDojade Documentation

PDOAnnouncementRepository
in package
implements AnnouncementRepositoryInterface

Read onlyYes
Tags
inheritDoc

Table of Contents

Interfaces

AnnouncementRepositoryInterface
Describes behavior of the announcement repository

Properties

$DATE_FORMAT  : string
$dbHelper  : DatabaseService
$TABLE_NAME  : string

Methods

__construct()  : mixed
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.
mapRow()  : Announcement
Maps database row to Announcement entity.

Properties

Methods

deleteRejectedOlderThan()

Deletes rejected announcements older than the specified date.

public deleteRejectedOlderThan(DateTimeImmutable $date) : int
Parameters
$date : DateTimeImmutable
Tags
inheritDoc
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
inheritDoc
Return values
array<string|int, Announcement>

        
On this page

Search results