CloudObjects/SDK/NodeReader.php
public function hasType(Node $node = null, $type) {
        if (!isset($node))
            return false;
        $type = $this->expand($type);
        $typesFromNode = $node->getType();
        if (!isset($typesFromNode))
            return false;
        if (is_array($typesFromNode)) {
            foreach ($typesFromNode as $t)
                if (is_a($t, 'ML\JsonLD\Node')
                    && $t->getId() == $type)
                return true;
        } else
        if (is_a($typesFromNode, 'ML\JsonLD\Node')
                && $typesFromNode->getId() == $type)
            return true;
        else
            return false;
        
        return false;
    }
public function hasType(Node $node = null, $type) {
        if (!isset($node))
            return false;
        $type = $this->expand($type);
        $typesFromNode = $node->getType();
        if (!isset($typesFromNode))
            return false;
        if (is_array($typesFromNode)) {
            foreach ($typesFromNode as $t)
                if (is_a($t, 'ML\JsonLD\Node')
                    && $t->getId() == $type)
                return true;
        } else
        if (is_a($typesFromNode, 'ML\JsonLD\Node')
                && $typesFromNode->getId() == $type)
            return true;
        else
            return false;
        
        return false;
    }
public function hasType ( Node $ node = null , $ type ) { if ( ! isset ( $ node ) ) return false ; $ type = $ this -> expand ( $ type ) ; $ typesFromNode = $ node -> getType ( ) ; if ( ! isset ( $ typesFromNode ) ) return false ; if ( is_array ( $ typesFromNode ) ) { foreach ( $ typesFromNode as $ t ) if ( is_a ( $ t , 'ML\JsonLD\Node' ) && $ t -> getId ( ) == $ type ) return true ; } else if ( is_a ( $ typesFromNode , 'ML\JsonLD\Node' ) && $ typesFromNode -> getId ( ) == $ type ) return true ; else return false ; return false ; }
Checks whether a node has a certain type.

@param Node $node The node to work on.
@param string|object $type The type to check for.
@return boolean
Checks whether a node has a certain type .