You are here

public function QPACssEventHandler::directDescendant in QueryPath 6

Same name and namespace in other branches
  1. 7.3 qpa/qpa.classes.inc \QPACssEventHandler::directDescendant()
  2. 7.2 qpa/qpa.classes.inc \QPACssEventHandler::directDescendant()

Overrides CssEventHandler::directDescendant

File

qpa/qpa.classes.inc, line 177
qpa.classes

Class

QPACssEventHandler
qpa.classes

Code

public function directDescendant() {
  $found = array();

  // For each match...
  foreach ($this->matches as $m) {

    // If it has children that are arrays...
    $val = $this
      ->getVal($m);
    if (is_array($val)) {

      // Go through each child...
      foreach ($val as $k => $v) {

        // And add any elements found to the $found array.
        if ($k[0] != '#') {
          $found[] = array(
            $m,
            $k,
          );
        }
      }
    }
  }
  $this->matches = $found;
}