Skip to content

PermissionRepository getChildren method return empty array #18

@MmadiZaib

Description

@MmadiZaib

Hello @Olivier127 !

When I try to call the getChildren method in PermissionRepository I got an empty array. And when I execute the sql request in phpmyadmin I got result.

With this code in PermissionRepository I got en empty array :

        $rsm = new ResultSetMapping();
        $rsm->addEntityResult($this->getClassName(), 'node');
        $query = $this->getEntityManager()
            ->createNativeQuery($sql, $rsm);
        $query->setParameter('nodeId', $nodeId);

But If I replace the code by this code below I got result :

        $result = ($this->getEntityManager()->getConnection()->executeQuery($sql, [
            'nodeId' => $nodeId,
        ]))->fetchAllAssociative();

Thanks you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions