Fixes activesync not being able to display contact photos sent from server.
}
/* Retrieve the search results from the driver. */
- $objects = $this->_search($fields, $return_fields);
+ $objects = $this->_search($fields, $return_fields, $this->toDriverKeys($this->getBlobs()));
return $this->_toTurbaObjects($objects, $sort_order);
}
* @return array Hash containing the search results.
* @throws Turba_Exception
*/
- protected function _search($criteria, $fields)
+ protected function _search($criteria, $fields, $blobFields = array())
{
throw new Turba_Exception(_("Searching is not available."));
}
* @return array Hash containing the search results.
* @throws Turba_Exception
*/
- protected function _read($key, $ids, $owner, $fields)
+ protected function _read($key, $ids, $owner, $fields, $blobFields = array())
{
throw new Turba_Exception(_("Reading contacts is not available."));
}
* @return array Hash containing the search results.
* @throws Turba_Exception
*/
- protected function _search($criteria, $fields)
+ protected function _search($criteria, $fields, $blobFields = array())
{
$results = $this->_getAddressBook($fields);
* @return array Hash containing the search results.
* @throws Turba_Exception
*/
- protected function _search($criteria, $fields)
+ protected function _search($criteria, $fields, $blobFields = array())
{
$results = array();
* @return array Hash containing the search results.
* @throws Turba_Exception
*/
- protected function _search($criteria, $fields)
+ protected function _search($criteria, $fields, $blobFields = array())
{
$results = array();
*
* @return array Hash containing the search results.
*/
- protected function _search($criteria, $fields)
+ protected function _search($criteria, $fields, $blobFields = array())
{
$query = $results = array();
*
* @return Hash containing the search results.
*/
- protected function _search($criteria, $fields)
+ protected function _search($criteria, $fields, $blobFields = array())
{
return $this->_wrapper->_search($criteria, $fields);
}
* @return array Hash containing the search results.
* @throws Turba_Exception
*/
- protected function _search($criteria, $fields)
+ protected function _search($criteria, $fields, $blobFields = array())
{
/* Build the LDAP filter. */
$filter = '';
*
* @return array Hash containing the search results.
*/
- protected function _search($criteria, $fields)
+ protected function _search($criteria, $fields, $blobFields = array())
{
return array_values($this->_getAddressBook());
}
* @return array Hash containing the search results.
* @throws Turba_Exception
*/
- protected function _search($criteria, $fields)
+ protected function _search($criteria, $fields, $blobFields = array())
{
- return $this->_driver->_search($criteria, $fields);
+ return $this->_driver->_search($criteria, $fields, $blobFields);
}
/**
*
* @param array $criteria Array containing the search criteria.
* @param array $fields List of fields to return.
+ * @param array $blobFields
* @param array $appendWhere An additional where clause to append.
* Array should contain 'sql' and 'params'
* params are used as bind parameters.
* @return array Hash containing the search results.
* @throws Turba_Exception
*/
- protected function _search($criteria, $fields, $appendWhere = array())
+ protected function _search($criteria, $fields, $blobFields = array(), $appendWhere = array())
{
/* Build the WHERE clause. */
$where = '';
throw new Turba_Exception($row);
}
- $row = $this->_convertFromDriver($row);
-
$entry = array();
for ($i = 0; $i < $iMax; $i++) {
$field = $fields[$i];
- $entry[$field] = $row[$i];
+ if (isset($blobFields[$field])) {
+ switch ($this->_db->dbsyntax) {
+ case 'pgsql':
+ case 'mssql':
+ $entry[$field] = pack('H' . strlen($row[$i]), $row[$i]);
+ break;
+
+ default:
+ $entry[$field] = $row[$i];
+ break;
+ }
+ } else {
+ $entry[$field] = $this->_convertFromDriver($row[$i]);
+ }
}
$results[] = $entry;
}
}
}
- return $this->_toTurbaObjects($this->_search($criteria, $fields, $where));
+ return $this->_toTurbaObjects($this->_search($criteria, $fields, array(), $where));
}
}
* @return array Hash containing the search results.
* @throws Turba_Exception
*/
- protected function _search($criteria, $fields)
+ protected function _search($criteria, $fields, $blobFields = array())
{
/* Add the passed in search criteria to the vbook criteria
* (which need to be mapped from turba fields to
* driver-specific fields). */
$criteria['AND'][] = $this->makeSearch($this->searchCriteria, 'AND', array());
- return $this->_driver->_search($criteria, $fields);
+ return $this->_driver->_search($criteria, $fields, $blobFields);
}
/**