1 <?php
2 /* --------------------------------------------------------------
3 EmailReaderInterface.inc.php 2015-01-29 gm
4 Gambio GmbH
5 http://www.gambio.de
6 Copyright (c) 2015 Gambio GmbH
7 Released under the GNU General Public License (Version 2)
8 [http://www.gnu.org/licenses/gpl-2.0.html]
9 --------------------------------------------------------------
10 */
11
12 /**
13 * Interface EmailReaderInterface
14 *
15 * @category System
16 * @package Email
17 * @subpackage Interfaces
18 */
19 interface EmailReaderInterface
20 {
21 /**
22 * Get email records filtered by conditions.
23 *
24 * @param array $conditions (optional) Contains conditions with column => value pairs.
25 * @param array $limit (optional) Array that contains LIMIT and OFFSET value
26 * e.g. array( 'limit' => 10, 'offset' => 5 )
27 * @param array $order (optional) Contains arrays with column, direction pairs
28 * e.g. array( 'column' => 'direction' )
29 *
30 * @return EmailCollection Returns a collection containing the email records.
31 */
32 public function get(array $conditions = array(), array $limit = array(), array $order = array());
33
34
35 /**
36 * Filter email records with provided keyword string.
37 *
38 * @param string $p_keyword String to be used for filtering the email records.
39 * @param array $limit (optional) Array that contains LIMIT and OFFSET value
40 * e.g. array( 'limit' => 10, 'offset' => 5 )
41 * @param array $order (optional) Contains arrays with column, direction pairs
42 * e.g. array( 'column' => 'direction' )
43 *
44 * @return EmailCollection Returns a collection containing the email records.
45 */
46 public function filter($p_keyword, array $limit = array(), array $order = array());
47
48
49 /**
50 * Get the current count of the email records in the database.
51 *
52 * This method will quickly return the record count of the "emails" table. It must
53 * be used when we just need the number and not the data, because the "get" or "find"
54 * methods need more time to load and parse the records.
55 *
56 * @param string $p_filterKeyword (optional) If provided the records will be filtered.
57 *
58 * @throws InvalidArgumentException If the provided argument is not a string.
59 *
60 * @return int Returns the row number of the email table.
61 */
62 public function getRecordCount($p_filterKeyword = '');
63 }