Craft\AmNavService::getNodesByNavigationId PHP Method

getNodesByNavigationId() public method

Get all nodes by its navigation ID.
public getNodesByNavigationId ( integer $navId, string $locale = null ) : array
$navId integer
$locale string
return array
    public function getNodesByNavigationId($navId, $locale = null)
    {
        // Fallback to current locale
        $locale = is_null($locale) ? craft()->language : $locale;
        // Set necessary variables
        $this->_siteUrl = craft()->getSiteUrl();
        $this->_addTrailingSlash = craft()->config->get('addTrailingSlashesToUrls');
        // Start at the root by default
        $parentId = 0;
        // Do we have to start from a specific node ID?
        $startFromId = $this->_getParam('startFromId', false);
        if ($startFromId !== false) {
            $parentId = $startFromId;
        }
        // Get nodes
        $nodes = craft()->amNav_node->getAllNodesByNavigationId($navId, $locale);
        // Find the active nodes if needed
        if ($this->_parseEnvironment) {
            $this->_setActiveNodes($nodes);
        }
        // Return the navigation
        if ($this->_parseHtml) {
            return $this->_buildNavHtml($nodes, $parentId);
        }
        return $this->_buildNav($nodes, $parentId);
    }