Skip to content

Commit

Permalink
Don't grab column information unless/until needed
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Apr 2, 2014
1 parent eb987ea commit de6d061
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion turba/lib/Driver/Sql.php
Expand Up @@ -179,13 +179,15 @@ protected function _internalSearch(array $criteria, array $fields, $blobFields =
protected function _parseRead($blobFields, $result, $dateFields = array())
{
$results = array();
$columns = $this->_db->columns($this->_params['table']);

foreach ($result as $row) {
$entry = array();

foreach ($row as $field => $val) {
if (isset($blobFields[$field])) {
if (!isset($columns)) {
$columns = $this->_db->columns($this->_params['table']);
}
$entry[$field] = $columns[$field]->binaryToString($val);
} elseif (isset($dateFields[$field]) && !empty($val)) {
$d = new Horde_Date($val);
Expand Down

0 comments on commit de6d061

Please sign in to comment.