Craft\AmNavService::_isChildActive PHP Method

_isChildActive() private method

Check whether a node has an active child.
private _isChildActive ( array $nodes, integer $parentId ) : boolean
$nodes array
$parentId integer
return boolean
    private function _isChildActive($nodes, $parentId)
    {
        foreach ($nodes as $node) {
            if ($node['parentId'] == $parentId) {
                // Is current node active?
                if (in_array($node['id'], $this->_activeNodeIds[$this->_navigation->handle])) {
                    return true;
                }
                // Is any of it's children active?
                $childrenResult = $this->_isChildActive($nodes, $node['id']);
                if ($childrenResult) {
                    return true;
                }
            }
        }
        return false;
    }