main/core/Repository/ResourceNodeRepository.php
private function executeQuery($query, $offset = null, $numrows = null, $asArray = true)
    {
        $query->setFirstResult($offset);
        $query->setMaxResults($numrows);

        if ($asArray) {
            $resources = $query->getArrayResult();
            $return = $resources;
            // Add a field "pathfordisplay" in each entity (as array) of the given array.
            foreach ($resources as $key => $resource) {
                if (isset($resource['path'])) {
                    $return[$key]['path_for_display'] = ResourceNode::convertPathForDisplay($resource['path']);
                }
            }

            return $return;
        }

        return $query->getResult();
    }
private function executeQuery($query, $offset = null, $numrows = null, $asArray = true)
    {
        $query->setFirstResult($offset);
        $query->setMaxResults($numrows);

        if ($asArray) {
            $resources = $query->getArrayResult();
            $return = $resources;
            // Add a field "pathfordisplay" in each entity (as array) of the given array.
            foreach ($resources as $key => $resource) {
                if (isset($resource['path'])) {
                    $return[$key]['path_for_display'] = ResourceNode::convertPathForDisplay($resource['path']);
                }
            }

            return $return;
        }

        return $query->getResult();
    }
private function executeQuery ( $ query , $ offset = null , $ numrows = null , $ asArray = true ) { $ query -> setFirstResult ( $ offset ) ; $ query -> setMaxResults ( $ numrows ) ; if ( $ asArray ) { $ resources = $ query -> getArrayResult ( ) ; $ return = $ resources ; // Add a field "pathfordisplay" in each entity (as array) of the given array. foreach ( $ resources as $ key => $ resource ) { if ( isset ( $ resource [ 'path' ] ) ) { $ return [ $ key ] [ 'path_for_display' ] = ResourceNode :: convertPathForDisplay ( $ resource [ 'path' ] ) ; } } return $ return ; } return $ query -> getResult ( ) ; }
Executes a DQL query and returns resources as entities or arrays.
If it returns arrays, it add a "pathfordisplay" field to each item.

@param Query $query   The query to execute
@param int   $offset  First row to start with
@param int   $numrows Maximum number of rows to return
@param bool  $asArray Whether the resources must be returned as arrays or as objects

@return array[AbstractResource|array]
Executes a DQL query and returns resources as entities or arrays . If it returns arrays it add a pathfordisplay field to each item .