You are here

class GoogleMiniResultIterator in Google Search Appliance 6.2

Same name and namespace in other branches
  1. 5 GoogleMini.php \GoogleMiniResultIterator

Hierarchy

Expanded class hierarchy of GoogleMiniResultIterator

File

./GoogleMini.php, line 367

View source
class GoogleMiniResultIterator extends ArrayIterator {
  public $time;
  public $payload;
  public $totalResults;
  function current() {
    $result = parent::current();
    return new GoogleMiniResult($result);
  }
  function __get($key) {
    return $this->payload->{$key};
  }

  /**
   * Returns an array of keymatches keyed with:
   * [link] => [title]
   *
   */
  function getKeyMatches() {
    $output = array();
    if ($this->GM) {
      foreach ($this->GM as $match) {
        $output[(string) $match->GL] = (string) $match->GD;
      }
    }
    return $output;
  }

  /**
   * Returns an array of synonyms.
   */
  function getSynonyms() {
    $output = array();
    if ($this->Synonyms) {
      foreach ($this->Synonyms
        ->children() as $child) {
        $output[] = (string) $child['q'];
      }
    }
    return $output;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
GoogleMiniResultIterator::$payload public property
GoogleMiniResultIterator::$time public property
GoogleMiniResultIterator::$totalResults public property
GoogleMiniResultIterator::current function
GoogleMiniResultIterator::getKeyMatches function Returns an array of keymatches keyed with: [link] => [title]
GoogleMiniResultIterator::getSynonyms function Returns an array of synonyms.
GoogleMiniResultIterator::__get function