public function extract($attributes) { $attributes = (array) $attributes; $count = count($attributes); $data = array(); foreach ($this->nodes as $node) { $elements = array(); foreach ($attributes as $attribute) { if ('_text' === $attribute) { $elements[] = $node->nodeValue; } else { $elements[] = $node->getAttribute($attribute); } } $data[] = $count > 1 ? $elements : $elements[0]; } return $data; }
public function extract($attribute, $asString = false) { return true === $asString ? implode(null, parent::extract($attribute)) : parent::extract($attribute); }