Class EmailRepository
Class EmailRepository
Handles the database operations that concern the email records of the
database. It provides a layer for more complicated methods that use the
writer, reader and deleter.
-
EmailRepository
implements
EmailRepositoryInterface
Methods summary
public
|
|
public
|
#
write( EmailInterface $email )
Writes an email record into the database.
Writes an email record into the database.
Parameters
- $email
- Contains the email information.
Implementation of
|
public
EmailInterface
|
#
getById( IdType $id )
Returns an email record by ID.
Returns an email record by ID.
Parameters
- $id
- Database ID of the record to be returned.
Returns
Throws
UnexpectedValueException If record does not exist.
Implementation of
|
public
EmailInterface |null
|
#
findById( IdType $id )
Find email by ID
This method will try to find the email record that matches provided ID and
will return NULL on when the record does not exist.
Parameters
- $id
- Email record id to be found.
Returns
Implementation of
|
public
EmailCollection
|
#
getPending( )
Returns a collection of pending emails.
Returns a collection of pending emails.
Returns
Implementation of
|
public
EmailCollection
|
#
getSent( )
Returns a collection of sent emails.
Returns a collection of sent emails.
Returns
Implementation of
|
public
EmailCollection
|
#
getAll( )
Returns all email records from the database.
Returns all email records from the database.
Returns
Implementation of
|
public
|
#
delete( EmailInterface $email )
Removes all information of an email record from the database.
Removes all information of an email record from the database.
This method will remove ALL the email information, from the tables that
contain information about the specified email.
Parameters
- $email
- Contains the email information.
Implementation of
|
public
EmailCollection
|
#
filter( string $p_keyword, array $limit = array(), array $order = array() )
Filter email records with provided keyword string.
Filter email records with provided keyword string.
Parameters
- $p_keyword
- String to be used for filtering the email records.
- $limit
(optional) Array that contains LIMIT and OFFSET value
e.g. array( 'limit' => 10, 'offset' => 5 )
- $order
(optional) Contains arrays with column, direction pairs
e.g. array( 'column' => 'direction' )
Returns
Implementation of
|
public
integer
|
#
getRecordCount( string $p_filterKeyword = '' )
Get the current count of the email records in the database.
Get the current count of the email records in the database.
Parameters
- $p_filterKeyword
- (optional) If provided the records will be filtered.
Returns
integer Returns the row number of the email table.
Implementation of
|