Returns the full ACL list.

Either a uri or a INode may be passed.

null will be returned if the node doesn't support ACLs.

@param string|DAV\INode $node

@return array
172429
public function getAcl($node)
    {
        if (is_string($node)) {
            $node = $this->server->tree->getNodeForPath($node);
        }
        if (!$node instanceof IACL) {
            return $this->getDefaultAcl();
        }
        $acl = $node->getACL();
        foreach ($this->adminPrincipals as $adminPrincipal) {
            $acl[] = [
                'principal' => $adminPrincipal,
                'privilege' => '{DAV:}all',
                'protected' => true,
            ];
        }

        return $acl;
    }
433448
protected function getUriInformation(NodeInterface $node, ControllerContext $controllerContext): array
    {
        $nodeInfo = [];
        if (!$node->getNodeType()->isOfType($this->documentNodeTypeRole)) {
            return $nodeInfo;
        }

        try {
            $nodeInfo['uri'] = $this->createRedirectToNode($controllerContext, $node);
        } catch (\Neos\Flow\Mvc\Routing\Exception\MissingActionNameException $exception) {
            // Unless there is a serious problem with routes there shouldn't be an exception ever.
            $nodeInfo['uri'] = '';
        }

        return $nodeInfo;
    }
30838
public function getTreeNodeClasses(SiteTree $node)
    {
        // Get classes from object
        $classes = $node->CMSTreeClasses();

        // Get status flag classes
        $flags = $node->getStatusFlags();
        if ($flags) {
            $statuses = array_keys($flags);
            foreach ($statuses as $s) {
                $classes .= ' status-' . $s;
            }
        }

        // Get additional filter classes
        $filter = $this->getSearchFilter();
        if ($filter && ($filterClasses = $filter->getPageClasses($node))) {
            if (is_array($filterClasses)) {
                $filterClasses = implode(' ', $filterClasses);
            }
            $classes .= ' ' . $filterClasses;
        }

        return trim($classes);
    }
901600
protected function _getOptions(&$node)
	{
		$options = array();
		foreach ($node->children() as $option)
		{
			$val  = $option['value'];
			$text = (string) $option;
			$options[] = Builder\Select::option($val, \App::get('language')->txt($text));
		}
		return $options;
	}
85008
private function getParentTreeParams(\Coral\ContentBundle\Entity\Node $node)
    {
        $params = $this->getDoctrine()->getManager()->createQuery(
                'SELECT n.level, na.name, na.value
                FROM CoralContentBundle:NodeAttribute na
                INNER JOIN na.node n WITH (n.lft < :lft AND n.rgt > :rgt)
                INNER JOIN n.account a WITH (a.id = :account_id)
                WHERE
                    na.name LIKE \'tree_%\'
                ORDER BY n.level ASC'
            )
            ->setParameter('account_id', $this->getAccount()->getId())
            ->setParameter('lft', $node->getLft())
            ->setParameter('rgt', $node->getRgt())
            ->getResult(\Doctrine\ORM\AbstractQuery::HYDRATE_ARRAY);

        $treeParams = array();

        foreach ($params as $param)
        {
            $treeParams[$param['name']] = $param['value'];
        }

        return $treeParams;
    }
646278
private function getLocationIDsByClassNode(NodeInterface $node) {
    if ($node->bundle() != 'class') {
      return [];
    }
    // Current node is a class.
    $class_id = $node->id();

    // Current date as timestamp.
    $current_date = strtotime("today UTC");

    /* @see \Drupal\openy_schedules\Form\SchedulesSearchForm::getSessions */
    $conditions['class'] = $class_id;
    $conditions['from'] = $current_date;

    $upcoming_session_instances = $this->getSessionInstancesByParams($conditions);

    $nids = [];
    foreach ($upcoming_session_instances as $session_instance) {
      $location_id = $session_instance->location->target_id;
      $nids[$location_id] = $location_id;
    }

    return $nids;
  }
23468
static function getChain(\Throwable $node): array
    {
        $chain = [];
        $hashMap = [];

        while ($node !== null && !isset($hashMap[$hash = spl_object_hash($node)])) {
            $chain[] = $node;
            $hashMap[$hash] = true;
            $node = $node->getPrevious();
        }

        return $chain;
    }
1336223
public function derefNodes($node, array $fields = [], ?string $return = null): array
    {
        if (!$node instanceof Node) {
            return [];
        }

        return $this->ncrCache->derefNodes($node, $fields, $return);
    }
1327163
private function getNodes($node)
    {
        $this->logger->info('[Get Nodes] Retrieving nodes...');

        $stripUnlikelyCandidates = $this->configuration->getStripUnlikelyCandidates();

        $elementsToScore = [];

        /*
         * First, node prepping. Trash nodes that look cruddy (like ones with the
         * class name "comment", etc), and turn divs into P tags where they have been
         * used inappropriately (as in, where they contain no other block level elements.)
         */

        while ($node) {
            // Remove DOMComments nodes as we don't need them and mess up children counting
            if ($node->nodeType === XML_COMMENT_NODE) {
                $this->logger->debug(sprintf('[Get Nodes] Found comment node, removing... Node content was: \'%s\'', substr($node->nodeValue, 0, 128)));
                $node = NodeUtility::removeAndGetNext($node);
                continue;
            }

            $matchString = $node->getAttribute('class') . ' ' . $node->getAttribute('id');

            if (!$node->isProbablyVisible()) {
                $this->logger->debug(sprintf('[Get Nodes] Removing hidden node... Match string was: \'%s\'', $matchString));
                $node = NodeUtility::removeAndGetNext($node);
                continue;
            }

            // Check to see if this node is a byline, and remove it if it is.
            if ($this->checkByline($node, $matchString)) {
                $this->logger->debug(sprintf('[Get Nodes] Found byline, removing... Node content was: \'%s\'', substr($node->nodeValue, 0, 128)));
                $node = NodeUtility::removeAndGetNext($node);
                continue;
            }

            // Remove unlikely candidates
            if ($stripUnlikelyCandidates) {
                if (
                    preg_match(NodeUtility::$regexps['unlikelyCandidates'], $matchString) &&
                    !preg_match(NodeUtility::$regexps['okMaybeItsACandidate'], $matchString) &&
                    $node->nodeName !== 'body' &&
                    $node->nodeName !== 'a'
                ) {
                    $this->logger->debug(sprintf('[Get Nodes] Removing unlikely candidate. Node content was: \'%s\'', substr($node->nodeValue, 0, 128)));
                    $node = NodeUtility::removeAndGetNext($node);
                    continue;
                }
            }

            // Remove DIV, SECTION, and HEADER nodes without any content(e.g. text, image, video, or iframe).
            if (($node->nodeName === 'div' || $node->nodeName === 'section' || $node->nodeName === 'header' ||
                    $node->nodeName === 'h1' || $node->nodeName === 'h2' || $node->nodeName === 'h3' ||
                    $node->nodeName === 'h4' || $node->nodeName === 'h5' || $node->nodeName === 'h6' ||
                    $node->nodeName === 'p') &&
                $node->isElementWithoutContent()) {
                $this->logger->debug(sprintf('[Get Nodes] Removing empty \'%s\' node.', $node->nodeName));
                $node = NodeUtility::removeAndGetNext($node);
                continue;
            }

            if (in_array(strtolower($node->nodeName), $this->defaultTagsToScore)) {
                $this->logger->debug(sprintf('[Get Nodes] Adding node to score list, node content is: \'%s\'', substr($node->nodeValue, 0, 128)));
                $elementsToScore[] = $node;
            }

            // Turn all divs that don't have children block level elements into p's
            if ($node->nodeName === 'div') {
                // Put phrasing content into paragraphs.
                $p = null;
                $childNode = $node->firstChild;
                while ($childNode) {
                    $nextSibling = $childNode->nextSibling;
                    if ($childNode->isPhrasingContent()) {
                        if ($p !== null) {
                            $p->appendChild($childNode);
                        } elseif (!$childNode->isWhitespace()) {
                            $p = $this->dom->createElement('p');
                            $node->replaceChild($p, $childNode);
                            $p->appendChild($childNode);
                        }
                    } elseif ($p !== null) {
                        while ($p->lastChild && $p->lastChild->isWhitespace()) {
                            $p->removeChild($p->lastChild);
                        }
                        $p = null;
                    }
                    $childNode = $nextSibling;
                }

                /*
                 * Sites like http://mobile.slate.com encloses each paragraph with a DIV
                 * element. DIVs with only a P element inside and no text content can be
                 * safely converted into plain P elements to avoid confusing the scoring
                 * algorithm with DIVs with are, in practice, paragraphs.
                 */
                if ($node->hasSingleTagInsideElement('p') && $node->getLinkDensity() < 0.25) {
                    $this->logger->debug(sprintf('[Get Nodes] Found DIV with a single P node, removing DIV. Node content is: \'%s\'', substr($node->nodeValue, 0, 128)));
                    $pNode = $node->getChildren(true)[0];
                    $node->parentNode->replaceChild($pNode, $node);
                    $node = $pNode;
                    $elementsToScore[] = $node;
                } elseif (!$node->hasSingleChildBlockElement()) {
                    $this->logger->debug(sprintf('[Get Nodes] Found DIV with a single child block element, converting to a P node. Node content is: \'%s\'', substr($node->nodeValue, 0, 128)));
                    $node = NodeUtility::setNodeTag($node, 'p');
                    $elementsToScore[] = $node;
                }
            }

            $node = NodeUtility::getNextNode($node);
        }

        return $elementsToScore;
    }
310170
protected function getOverridesNodes(NodeBuilder $node)
    {
        return $node
            ->arrayNode('on')
                ->info(<<< 'EOF'
In this section you can fine-tune the above configuration according
to the stage or connection currently in use.
Per example :
'stages' => [
    'staging' => [
        'vcs' => ['branch' => 'staging'],
    ],
     'production' => [
       'vcs' => ['branch' => 'master'],
     ],
],
EOF
                )
                ->children()
                    ->arrayNode('stages')
                        ->useAttributeAsKey('name')
                        ->prototype('array')
                            ->prototype('variable')->end()
                        ->end()
                    ->end()
                    ->arrayNode('connections')
                        ->useAttributeAsKey('name')
                        ->prototype('array')
                            ->prototype('variable')->end()
                        ->end()
                    ->end()
                ->end()
            ->end();
    }
357588
static protected function get_cell_list(\DOMNode $node)
    {
        $xpath = new \DOMXpath($node->ownerDocument);

        switch ($node->nodeName) {
            default:
            case "table":
                $query = "tr/td | thead/tr/td | tbody/tr/td | tfoot/tr/td | tr/th | thead/tr/th | tbody/tr/th | tfoot/tr/th";
                break;

            case "tbody":
            case "tfoot":
            case "thead":
                $query = "tr/td | tr/th";
                break;

            case "tr":
                $query = "td | th";
                break;
        }

        return $xpath->query($query, $node);
    }
200647
public function dumpNode(BaseNode $node)
    {
        return '<?php'.PHP_EOL.PHP_EOL.'return ['.parent::dumpNode($node).PHP_EOL.'];'.PHP_EOL;
    }
487170
public function getNodeCampMenu(NodeInterface $node) {
    if (!($camp = $this->getNodeCampNode($node))) {
      return [];
    }

    return $this->getCampNodeCampMenu($camp);
  }
223590
private function getSummary($node) {
    if (!($node instanceof NodeInterface)) {
      $node = $this->entityTypeManager->getStorage('node')->load($node);
    }

    $registeredMembers = $this->calculateRegisteredMembers($node);
    $totalMembers = $this->calculateAllMembers();
    $percentageMembers = 0;
    if ($totalMembers > 0) {
      $percentageMembers = round($registeredMembers / $totalMembers * 100, 2);
    }

    $activities = $this->calculateTrackedActivities($node);

    return [
      'registeredMembers' => $registeredMembers,
      'totalMembers' => $totalMembers,
      'percentageMembers' => $percentageMembers,
      'activities' => $activities,
    ];
  }
181759
public function indexAction(ResourceNode $node)
    {
        $resource = $this->manager->getResourceFromNode($node);

        $user = $this->get('security.token_storage')->getToken()->getUser();
        $isFavourite = $this->get('claroline.persistence.object_manager')->getRepository('HeVinciFavouriteBundle:Favourite')
            ->findOneBy(array('user' => $user, 'resourceNode' => $node));

        return array(
            'isFavourite' => $isFavourite ? true : false,
            '_resource' => $resource,
        );
    }
1120999
protected function _getOptions(&$node)
	{
		$options = array();
		$path1 = null;
		$path2 = null;

		// Load template entries for each menuid
		$db = App::get('db');

		$query = $db->getQuery()
			->select('template')
			->from('#__template_styles')
			->whereEquals('client_id', 0)
			->whereEquals('home', 1)
			->limit(1);
		$db->setQuery($query->toString());
		$template = $db->loadResult();

		$view = (string) $node['view'];
		$extn = (string) $node['extension'];
		if ($view && $extn)
		{
			$view = preg_replace('#\W#', '', $view);
			$extn = preg_replace('#\W#', '', $extn);
			$path1 = PATH_CORE . '/components/' . $extn . '/site/views/' . $view . '/tmpl';
			$path2 = PATH_ROOT . '/templates/' . $template . '/html/' . $extn . '/' . $view;
			$options[] = Builder\Select::option('', App::get('language')->txt('JOPTION_USE_MENU_REQUEST_SETTING'));
		}

		if ($path1 && $path2)
		{
			$path1 = Util::normalizePath($path1);
			$path2 = Util::normalizePath($path2);

			$files = App::get('filesystem')->files($path1, '^[^_]*\.php$');
			foreach ($files as $file)
			{
				$options[] = Builder\Select::option(App::get('filesystem')->extension($file));
			}

			if (is_dir($path2) && $files = App::get('filesystem')->files($path2, '^[^_]*\.php$'))
			{
				$options[] = Builder\Select::optgroup(App::get('language')->txt('JOPTION_FROM_DEFAULT_TEMPLATE'));
				foreach ($files as $file)
				{
					$options[] = Builder\Select::option(App::get('filesystem')->extension($file));
				}
				$options[] = Builder\Select::optgroup(App::get('language')->txt('JOPTION_FROM_DEFAULT_TEMPLATE'));
			}
		}

		// Merge any additional options in the XML definition.
		$options = array_merge(parent::_getOptions($node), $options);

		return $options;
	}
1157593
protected function getCurrentDimensionPresetIdentifiersForNode($node)
    {
        $targetPresets = $this->contentDimensionsPresetSource->findPresetsByTargetValues($node->getDimensions());
        $presetCombo = [];
        foreach ($targetPresets as $dimensionName => $presetConfig) {
            $fullPresetConfig = $this->contentDimensionsPresetSource->findPresetByDimensionValues($dimensionName, $presetConfig['values']);
            $presetCombo[$dimensionName] = $fullPresetConfig['identifier'];
        }
        return $presetCombo;
    }