]> git.donarmstrong.com Git - roundcube.git/blob - program/include/rcube_result_set.php
Imported Upstream version 0.7
[roundcube.git] / program / include / rcube_result_set.php
1 <?php
2
3 /*
4  +-----------------------------------------------------------------------+
5  | program/include/rcube_result_set.php                                  |
6  |                                                                       |
7  | This file is part of the Roundcube Webmail client                     |
8  | Copyright (C) 2006-2011, The Roundcube Dev Team                       |
9  | Licensed under the GNU GPL                                            |
10  |                                                                       |
11  | PURPOSE:                                                              |
12  |   Class representing an address directory result set                  |
13  |                                                                       |
14  +-----------------------------------------------------------------------+
15  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
16  +-----------------------------------------------------------------------+
17
18  $Id: rcube_result_set.php 5258 2011-09-21 11:17:46Z thomasb $
19
20 */
21
22
23 /**
24  * Roundcube result set class.
25  * Representing an address directory result set.
26  *
27  * @package Addressbook
28  */
29 class rcube_result_set
30 {
31     var $count = 0;
32     var $first = 0;
33     var $current = 0;
34     var $searchonly = false;
35     var $records = array();
36
37
38     function __construct($c=0, $f=0)
39     {
40         $this->count = (int)$c;
41         $this->first = (int)$f;
42     }
43
44     function add($rec)
45     {
46         $this->records[] = $rec;
47     }
48
49     function iterate()
50     {
51         return $this->records[$this->current++];
52     }
53
54     function first()
55     {
56         $this->current = 0;
57         return $this->records[$this->current++];
58     }
59
60     // alias for iterate()
61     function next()
62     {
63         return $this->iterate();
64     }
65
66     function seek($i)
67     {
68         $this->current = $i;
69     }
70
71 }