phpQueryObject::is PHP Method

is() public method

..
public is ( $selector, $nodes = null ) : phpQueryObject | QueryTemplatesSource | QueryTemplatesParse | QueryTemplatesSourceQuery
return phpQueryObject | QueryTemplatesSource | QueryTemplatesParse | QueryTemplatesSourceQuery
    public function is($selector, $nodes = null)
    {
        phpQuery::debug(array('Is:', $selector));
        if (!$selector) {
            return false;
        }
        $oldStack = $this->elements;
        $returnArray = false;
        if ($nodes && is_array($nodes)) {
            $this->elements = $nodes;
        } elseif ($nodes) {
            $this->elements = array($nodes);
        }
        $this->filter($selector, true);
        $stack = $this->elements;
        $this->elements = $oldStack;
        if ($nodes) {
            return $stack ? $stack : null;
        }
        return (bool) count($stack);
    }