Save error state in kolab_storage_cache::select() return value
This commit is contained in:
parent
98741574d9
commit
816356813c
2 changed files with 19 additions and 0 deletions
|
@ -453,6 +453,7 @@ class kolab_storage_cache
|
|||
);
|
||||
|
||||
if ($this->db->is_error($sql_result)) {
|
||||
$result->set_error(true);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@ -483,6 +484,7 @@ class kolab_storage_cache
|
|||
}
|
||||
|
||||
if ($index->is_error()) {
|
||||
$result->set_error(true);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ class kolab_storage_dataset implements Iterator, ArrayAccess, Countable
|
|||
private $index = array();
|
||||
private $data = array();
|
||||
private $iteratorkey = 0;
|
||||
private $error = null;
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
|
@ -49,6 +50,22 @@ class kolab_storage_dataset implements Iterator, ArrayAccess, Countable
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return error state
|
||||
*/
|
||||
public function is_error()
|
||||
{
|
||||
return !empty($this->error);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set error state
|
||||
*/
|
||||
public function set_error($err)
|
||||
{
|
||||
$this->error = $err;
|
||||
}
|
||||
|
||||
|
||||
/*** Implement PHP Countable interface ***/
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue