Return the resource rights as a readable array. This array can be used for the resource creation.

@param ResourceNode $node

@return array

@deprecated use getRights()
764654
public function getCustomRoleRights(ResourceNode $node)
    {
        $perms = [];

        foreach ($node->getRights() as $right) {
            //if not ROLE_ANONYMOUS nor ROLE_USER because they're added automatically in ResourceManager::createRights
            if ('ROLE_ANONYMOUS' !== $right->getRole()->getName() && 'ROLE_USER' !== $right->getRole()->getName()) {
                $rolePerms = $this->maskManager->decodeMask($right->getMask(), $node->getResourceType());
                $perms[$right->getRole()->getName()] = $rolePerms;
                $perms[$right->getRole()->getName()]['role'] = $right->getRole();
                //no implementation for rights creations yet
                $perms[$right->getRole()->getName()]['create'] = [];
            }
        }

        return $perms;
    }
30379
public function processNode(Node $node, Scope $scope): array
    {
        if (!isset($node->namespacedName) || !$node->getReturnType() instanceof Node\NullableType) {
            return [];
        }

        return [
            \sprintf(
                'Function %s() has a nullable return type declaration.',
                $node->namespacedName
            ),
        ];
    }
1253188
public function getResourceFromNode(ResourceNode $node)
    {
        return $this->om->getRepository($node->getClass())->findOneByResourceNode($node);
    }
1017940
protected function nodeToDictionary( Node $node )
    {
        $result = $node->attributes;

        $containerKeys = [];

        foreach ($node->children as $child) {
            $arrayChild = $this->nodeToDictionary($child);

            $childName = $child->name;
            $childValue = $arrayChild;

            if (sizeof($child->children) == 0) {
                $childValue = $child->text;
            }

            if (isset( $result[ $childName ] )) {
                if (!in_array($childName, $containerKeys)) {
                    $result[ $childName ] = [$result[ $childName ]];
                    $containerKeys[] = $childName;
                }

                $result[ $childName ][] = $childValue;
            } else {
                $result[ $childName ] = $childValue;
            }
        }

        return $result;
    }
1074890
public function getNode( $node )
	{
		for( $i=0; $i<$this->count(); $i++ )
			if( $this->nodes[$i]->getNodeName() == $node )
				return $this->nodes[$i];
		return NULL;
	}
1108944
private static function _getNodePath($node)
    {
        $ret = array();
        $doc = $node->ownerDocument;
        $parentNode = $node->parentNode;

        while ($parentNode !== null && !$doc->isSameNode($parentNode)) {
            // gets the sibling position
            $pos = 0;
            foreach ($parentNode->childNodes as $i => $childNode) {
                if ($childNode->isSameNode($node)) {
                    $pos = $i;
                    break;
                }
            }

            array_unshift($ret, $pos);
            $node = $parentNode;
            $parentNode = $node->parentNode;
        }

        return $ret;
    }
674830
public function getResourceTypeForNode(INode $node)
    {
        $result = [];
        foreach ($this->resourceTypeMapping as $className => $resourceType) {
            if ($node instanceof $className) {
                $result[] = $resourceType;
            }
        }

        return $result;
    }
342057
private function decodeArrayNode(\DOMNode $node): array
    {
        $data = [];
        foreach ($node->childNodes as $childNode) {
            if ($childNode instanceof \DOMText) {
                continue;
            }

            $data[] = $this->decodeNode($childNode);
        }

        return $data;
    }
294086
public function getValueForNode(Node $node)
    {
        if ($node->isNamed()) {
            return $node->getUri();
        } elseif ($node->isLiteral()) {
            return $node->getValue();
        } elseif ($node->isBlank()) {
            return $node->getBlankId();
        } else {
            return null;
        }
    }
488063
public function getGroups($node) {

    $groupcontents = GroupContent::loadByEntity($node);

    $groups = [];
    // Only react if it is actually posted inside a group.
    if (!empty($groupcontents)) {
      foreach ($groupcontents as $groupcontent) {
        /* @var \Drupal\group\Entity\GroupContent $groupcontent */
        $group = $groupcontent->getGroup();
        /* @var \Drupal\group\Entity\Group $group */
        $groups[] = $group;
      }
    }

    return $groups;
  }
107576
public function getParamTypeInfos(Node $node): array
    {
        if ($node->getDocComment() === null) {
            return [];
        }

        $phpDocInfo = $this->createPhpDocInfoFromNode($node);
        $types = $phpDocInfo->getParamTagValues();

        if ($types === []) {
            return [];
        }

        $fqnTypes = $phpDocInfo->getParamTagValues();

        $paramTypeInfos = [];
        /** @var AttributeAwareParamTagValueNode $paramTagValueNode */
        foreach ($types as $i => $paramTagValueNode) {
            $fqnParamTagValueNode = $fqnTypes[$i];

            $paramTypeInfo = new ParamTypeInfo(
                $paramTagValueNode->parameterName,
                $this->typeAnalyzer,
                $paramTagValueNode->getAttribute(Attribute::TYPE_AS_ARRAY),
                $fqnParamTagValueNode->getAttribute(Attribute::RESOLVED_NAMES)
            );

            $paramTypeInfos[$paramTypeInfo->getName()] = $paramTypeInfo;
        }

        return $paramTypeInfos;
    }
124951
public function getFlattenChildren(Node $node)
    {
        $flatten = array();
        foreach ($node->getNodes() as $subNode) {
            if (count($subNode->getNodes()) > 1 || isset($subNode->getTrace()['query_source']) || !empty($subNode->getValues())) {
                $flatten[] = $subNode;
            } else {
                $flatten = array_merge($flatten, $this->getFlattenChildren($subNode));
            }
        }

        return $flatten;
    }
821247
public function findCreationRights(array $roles, ResourceNode $node)
    {
        if (0 === count($roles)) {
            throw new \RuntimeException('Roles cannot be empty');
        }

        $dql = '
            SELECT DISTINCT rType.name
            FROM Claroline\CoreBundle\Entity\Resource\ResourceType AS rType
            JOIN rType.rights right
            JOIN right.role role
            JOIN right.resourceNode resource
            WHERE ';

        $index = 0;

        foreach ($roles as $key => $role) {
            $dql .= 0 !== $index ? ' OR ' : '';
            $dql .= "resource.id = :nodeId AND role.name = :role_{$key}";
            ++$index;
        }

        $query = $this->_em->createQuery($dql);
        $query->setParameter('nodeId', $node->getId());

        foreach ($roles as $key => $role) {
            $query->setParameter('role_'.$key, $role);
        }

        return $query->getArrayResult();
    }
1037468
public function getIdempotencyKeys(Node $node): array
    {
        $qname = $node::schema()->getQName();
        $keys = [];

        if ($node->has('title')) {
            $keys[$this->getCacheKey($qname, SlugUtils::create($node->get('title')))] = true;
        }

        if ($node->has('slug')) {
            $keys[$this->getCacheKey($qname, $node->get('slug'))] = true;
        }

        if ($node instanceof User && $node->has('email')) {
            $keys[$this->getCacheKey($qname, $node->get('email'))] = true;
        }

        return array_keys($keys);
    }
1297975
public function importFormAction(ResourceNode $node)
    {
        $form = $this->formFactory->create(new ImportResourcesType());

        return array('form' => $form->createView(), 'directory' => $node);
    }
72602
protected function &getNode(&$node, $key)
    {
        if (is_array($node) && isset($node[$key])) {
            return $node[$key];
        }

        if (!is_object($node) || !isset($node->$key)) {
            $result = null;
            return $result;
        }

        // Special check for __isset and __get
        if (property_exists($node, $key)) {
            return $node->$key;
        }

        if (method_exists($node, '__get')) {
            $value = $node->__get($key);
            return $value;
        }

        $result = null;
        return $result;
    }
503359
protected function getGrantedNodes(array $nodes)
    {
        /**
         * @var ReadNodeInterface $node
         */
        foreach ($nodes as $key => $node) {
            if (!$this->isGrantedNode($node)) {
                unset($nodes[$key]);
            }
        }

        return $nodes;
    }