Example #1
0
 /**
  * @param string $name
  * @param int    $index
  *
  * @return Set
  */
 public function getElementsByTagName($name, $index = null)
 {
     if (is_null($index)) {
         return $this->set(parent::getElementsByTagName($name));
     }
     return $this->ownerDocument->notEmpty($this->set(parent::getElementsByTagName($name))->item($index), $name);
 }
Example #2
0
File: Set.php Project: volux/dom
 /**
  * @return Attr|Element|Tag|Field|Text|Cdata|Comment
  */
 public function last()
 {
     if ($this->valid()) {
         $this->seek($this->count() - 1);
         return $this->current();
     }
     return $this->ownerDocument->notEmpty(false, 'Set::last()');
 }