You are here

class FeedsLdapQueryFetcherResult in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 7.2 ldap_feeds/FeedsLdapQueryFetcher.inc \FeedsLdapQueryFetcherResult
  2. 7 ldap_feeds/FeedsLdapQueryFetcher.inc \FeedsLdapQueryFetcherResult

FeedsLdapQueryFetcherResult

Hierarchy

Expanded class hierarchy of FeedsLdapQueryFetcherResult

File

ldap_feeds/FeedsLdapQueryFetcher.inc, line 12
FeedsLdapQueryFetcher

View source
class FeedsLdapQueryFetcherResult extends FeedsFetcherResult {
  public $query_ids = array();
  public $ldap_result;

  /**
   * Constructor.
   */
  public function __construct($source_config) {
    $this->query_ids = isset($source_config['query_ids']) && is_array($source_config['query_ids']) ? $source_config['query_ids'] : array();
    parent::__construct('');
    $this->ldap_result = $this
      ->getRaw();
    return $this->ldap_result;
  }

  /**
   * Overrides parent::getRaw();
   */
  public function getRaw() {
    $results = array();
    foreach ($this->query_ids as $i => $query_id) {
      $ldapQuery = ldap_query_get_queries($query_id, 'enabled', TRUE);
      $more_results = $ldapQuery
        ->query();
      if (is_array($more_results)) {
        $results = array_merge($results, $more_results);
      }
    }
    return $results;
  }

}

Members