phpQueryObject::stack PHP Method

stack() public method

Internal stack iterator.
public stack ( $nodeTypes = null )
    public function stack($nodeTypes = null)
    {
        if (!isset($nodeTypes)) {
            return $this->elements;
        }
        if (!is_array($nodeTypes)) {
            $nodeTypes = array($nodeTypes);
        }
        $return = array();
        foreach ($this->elements as $node) {
            if (in_array($node->nodeType, $nodeTypes)) {
                $return[] = $node;
            }
        }
        return $return;
    }