Class EmailReader

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").

EmailReader implements EmailReaderInterface uses HtmlUtilityTrait

Methods summary

public __construct( CI_DB_query_builder $db, EmailFactoryInterface $factory )

Class Constructor

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

Get email records filtered by conditions.

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

Filter email records with provided keyword string.

public getRecordCount( string $p_filterKeyword = '' ) : integer

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

protected _createEmailByArray( array $emailDataArray ) : Email

Creates an email object out of an array.

protected _filter( string $p_keyword )

Apply filter rules to email records.

protected _limit( array $rule )

Apply LIMIT clause to query.

protected _order( array $rule )

Apply ORDER BY clause to query.

Methods used from HtmlUtilityTrait

htmlEntityDecodeWrapper(), htmlentitiesWrapper()

Properties summary

protected $db : CI_DB_query_builder

Query builder.


		
protected $factory : EmailFactory

E-Mail factory.