source: github/program/include/rcube_result_set.php @ e9a9f2f6

HEADcourier-fixdev-browser-capabilitiespdorelease-0.6release-0.7release-0.8
Last change on this file since e9a9f2f6 was e9a9f2f6, checked in by alecpl <alec@…>, 2 years ago
  • Added addressbook advanced search
  • Property mode set to 100644
File size: 1.7 KB
Line 
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-2010, 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$
19
20*/
21
22
23/**
24 * Roundcube result set class.
25 * Representing an address directory result set.
26 *
27 * @package Addressbook
28 */
29class rcube_result_set
30{
31    var $count = 0;
32    var $first = 0;
33    var $current = 0;
34    var $records = array();
35
36
37    function __construct($c=0, $f=0)
38    {
39        $this->count = (int)$c;
40        $this->first = (int)$f;
41    }
42
43    function add($rec)
44    {
45        $this->records[] = $rec;
46    }
47
48    function iterate()
49    {
50        return $this->records[$this->current++];
51    }
52
53    function first()
54    {
55        $this->current = 0;
56        return $this->records[$this->current++];
57    }
58
59    // alias for iterate()
60    function next()
61    {
62        return $this->iterate();
63    }
64
65    function seek($i)
66    {
67        $this->current = $i;
68    }
69
70}
Note: See TracBrowser for help on using the repository browser.