PHPHtmlParser\Dom\AbstractNode::id PHP Method

id() public method

Returns the id of this object.
public id ( )
    public function id()
    {
        return $this->id;
    }

Usage Example

Esempio n. 1
0
 /**
  * Attempts to get an ancestor node by the given id.
  *
  * @param int $id
  * @return null|AbstractNode
  */
 public function getAncestor($id)
 {
     if (!is_null($this->parent)) {
         if ($this->parent->id() == $id) {
             return $this->parent;
         }
         return $this->parent->getAncestor($id);
     }
     return null;
 }
All Usage Examples Of PHPHtmlParser\Dom\AbstractNode::id