1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 
<?php
/* --------------------------------------------------------------
   EmailReaderInterface.inc.php 2015-01-29 gm
   Gambio GmbH
   http://www.gambio.de
   Copyright (c) 2015 Gambio GmbH
   Released under the GNU General Public License (Version 2)
   [http://www.gnu.org/licenses/gpl-2.0.html]
   --------------------------------------------------------------
*/

/**
 * Interface EmailReaderInterface
 *
 * @category   System
 * @package    Email
 * @subpackage Interfaces
 */
interface EmailReaderInterface
{
    /**
     * Get email records filtered by conditions.
     *
     * @param array $conditions (optional) Contains conditions with column => value pairs.
     * @param array $limit      (optional) Array that contains LIMIT and OFFSET value
     *                          e.g. array( 'limit' => 10, 'offset' => 5 )
     * @param array $order      (optional) Contains arrays with column, direction pairs
     *                          e.g. array( 'column' => 'direction' )
     *
     * @return EmailCollection Returns a collection containing the email records.
     */
    public function get(array $conditions = array(), array $limit = array(), array $order = array());


    /**
     * Filter email records with provided keyword string.
     *
     * @param string $p_keyword String to be used for filtering the email records.
     * @param array  $limit     (optional) Array that contains LIMIT and OFFSET value
     *                          e.g. array( 'limit' => 10, 'offset' => 5 )
     * @param array  $order     (optional) Contains arrays with column, direction pairs
     *                          e.g. array( 'column' => 'direction' )
     *
     * @return EmailCollection Returns a collection containing the email records.
     */
    public function filter($p_keyword, array $limit = array(), array $order = array());


    /**
     * Get the current count of the email records in the database.
     *
     * 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.
     *
     * @param string $p_filterKeyword (optional) If provided the records will be filtered.
     *
     * @throws InvalidArgumentException If the provided argument is not a string.
     *
     * @return int Returns the row number of the email table.
     */
    public function getRecordCount($p_filterKeyword = '');
}