|
|
@ -25,7 +25,7 @@
|
|
|
|
* @package Framework
|
|
|
|
* @package Framework
|
|
|
|
* @subpackage Addressbook
|
|
|
|
* @subpackage Addressbook
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
class rcube_result_set implements Iterator
|
|
|
|
class rcube_result_set implements Iterator, ArrayAccess
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public $count = 0;
|
|
|
|
public $count = 0;
|
|
|
|
public $first = 0;
|
|
|
|
public $first = 0;
|
|
|
@ -61,6 +61,34 @@ class rcube_result_set implements Iterator
|
|
|
|
$this->current = $i;
|
|
|
|
$this->current = $i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*** Implement PHP ArrayAccess interface ***/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function offsetSet($offset, $value)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (is_null($offset)) {
|
|
|
|
|
|
|
|
$offset = count($this->records);
|
|
|
|
|
|
|
|
$this->records[] = $value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
$this->records[$offset] = $value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function offsetExists($offset)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return isset($this->records[$offset]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function offsetUnset($offset)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
unset($this->records[$offset]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function offsetGet($offset)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return $this->records[$offset];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*** PHP 5 Iterator interface ***/
|
|
|
|
/*** PHP 5 Iterator interface ***/
|
|
|
|
|
|
|
|
|
|
|
|
function rewind()
|
|
|
|
function rewind()
|
|
|
|