EmailReader

Implements \EmailReaderInterface

Class EmailReader

Reads email records from the database. This class provides a customizable interface for reading operations so that it is possible to build different variations in the EmailRepository class (e.g. "getPending", "findById", "getAll").

category

System

package

Email

subpackage

Repository

Methods

Class Constructor

__construct(\CI_DB_query_builder $db, \EmailFactoryInterface $factory) 

Arguments

$db

\CI_DB_query_builder

Will be used for database operations.

$factory

\EmailFactoryInterface

Will be used for the creation of returned objects.

Filter email records with provided keyword string.

filter(string $p_keyword, array $limit = array(), array $order = array()) : \EmailCollection

Arguments

$p_keyword

string

String to be used for filtering the email records.

$limit

array

(optional) Array that contains LIMIT and OFFSET value e.g. array( 'limit' => 10, 'offset' => 5 )

$order

array

(optional) Contains arrays with column, direction pairs e.g. array( 'column' => 'direction' )

Response

\EmailCollection

Returns a collection containing the email records.

Get email records filtered by conditions.

get(array $conditions = array(), array $limit = array(), array $order = array()) : \EmailCollection

Example: $reader->get(array('email_id' => $customerId), 10, array( array('email_id', 'asc') ));

Arguments

$conditions

array

(optional) Contains conditions with column => value pairs.

$limit

array

(optional) Array that contains LIMIT and OFFSET value e.g. array( 'limit' => 10, 'offset' => 5 )

$order

array

(optional) Contains arrays with column, direction pairs e.g. array( 'column' => 'direction' )

Response

\EmailCollection

Returns a collection containing the email records.

Get the current count of the email records in the database.

getRecordCount(string $p_filterKeyword = '') : integer

This method will quickly return the record count of the "emails" table. It must be used when we just need the number and not the data, because the "get" or "find" methods need more time to load and parse the records.

Throws
\InvalidArgumentException

If the provided argument is not a string.

Arguments

$p_filterKeyword

string

(optional) If provided the records will be filtered.

Response

integer

Returns the row number of the email table.

htmlentitiesWrapper

htmlentitiesWrapper( $string,  $flags = false,  $encoding = '',  $doubleEncode = true) 
inherited

Arguments

$string

$flags

$encoding

$doubleEncode

htmlEntityDecodeWrapper

htmlEntityDecodeWrapper( $string,  $flags = false,  $encoding = '') 
inherited

Arguments

$string

$flags

$encoding

Properties