protected function _searchWhere(Surfnet_Search_Parameters $params, $where = '')
 {
     // Select Group Provider Records
     $dao = new EngineBlock_Model_DbTable_GroupProvider();
     $query = $dao->select()->from($dao);
     if (strlen(trim($where)) > 0) {
         $query->where($where);
     }
     if ($params->getLimit()) {
         $query->limit($params->getLimit(), $params->getOffset());
     }
     if ($params->getSortByField()) {
         $query->order('group_provider.' . $params->getSortByField() . ' ' . $params->getSortDirection());
     }
     $gpRecords = $dao->fetchAll($query);
     $gpRecords = $gpRecords->toArray();
     // get full classnames
     foreach ($gpRecords as &$record) {
         $record['fullClassname'] = $record['classname'];
         $record['classname'] = EngineBlock_Model_GroupProvider::getClassnameDisplayValue($record['classname']);
     }
     $totalCount = $dao->fetchRow($query->reset(Zend_Db_Select::LIMIT_COUNT)->reset(Zend_Db_Select::LIMIT_OFFSET)->columns(array('count' => 'COUNT(*)')))->offsetGet('count');
     return new Surfnet_Search_Results($params, $gpRecords, $totalCount);
 }
 protected function _mapRowToGroupProvider(Zend_Db_Table_Row_Abstract $row, array $options, $groupProvider)
 {
     $groupProvider->id = $row['id'];
     $groupProvider->identifier = $row['identifier'];
     $groupProvider->name = $row['name'];
     $groupProvider->logoUrl = $row['logo_url'];
     $groupProvider->fullClassname = $row['classname'];
     $groupProvider->classname = EngineBlock_Model_GroupProvider::getClassnameDisplayValue($row['classname']);
     // add options
     foreach ($options as $i => $option) {
         $column = $groupProvider->getColumnName($option['name']);
         if (strlen($column) > 0) {
             $groupProvider->{$column} = $option['value'];
         }
     }
     // special case: grouper URL is built from several components
     if ($groupProvider->classname == "GROUPER" && isset($groupProvider->host)) {
         $groupProvider->url = $groupProvider->protocol . '://' . $groupProvider->host . '/' . $groupProvider->version . '/' . $groupProvider->path;
         // clean multiple slashes (except ://)
         $groupProvider->url = preg_replace('/([^:])([\\/]+)([^\\/]|$)/', "\$1/\$3", $groupProvider->url);
     }
     return $groupProvider;
 }