public function getCollectionAction($start, MediaFolder $parent = null)
    {
        $mediaFolders = [];

        $results = $this->getMediaFolderRepository()->getMediaFolders($parent, [
            'field' => '_leftnode',
            'dir'   => 'asc',
        ]);

        foreach ($results as $folder) {

            if($this->isGranted('VIEW', $folder) || true === $folder->isRoot()){

                $mediaFolders[] = $folder;
            }
        }

        return $this->addRangeToContent($this->createJsonResponse($mediaFolders), $mediaFolders, $start);
    }
public function getCollectionAction($start, MediaFolder $parent = null)
    {
        $mediaFolders = [];

        $results = $this->getMediaFolderRepository()->getMediaFolders($parent, [
            'field' => '_leftnode',
            'dir'   => 'asc',
        ]);

        foreach ($results as $folder) {

            if($this->isGranted('VIEW', $folder) || true === $folder->isRoot()){

                $mediaFolders[] = $folder;
            }
        }

        return $this->addRangeToContent($this->createJsonResponse($mediaFolders), $mediaFolders, $start);
    }
public function getCollectionAction ( $ start , MediaFolder $ parent = null ) { $ mediaFolders = [ ] ; $ results = $ this -> getMediaFolderRepository ( ) -> getMediaFolders ( $ parent , [ 'field' => '_leftnode' , 'dir' => 'asc' , ] ) ; foreach ( $ results as $ folder ) { if ( $ this -> isGranted ( 'VIEW' , $ folder ) || true === $ folder -> isRoot ( ) ) { $ mediaFolders [ ] = $ folder ; } } return $ this -> addRangeToContent ( $ this -> createJsonResponse ( $ mediaFolders ) , $ mediaFolders , $ start ) ; }
Get collection of media folder

@return Response

@Rest\Pagination(default_count=100, max_count=200)

@Rest\ParamConverter(
name="parent", id_name="parent_uid", id_source="query", class="BackBee\NestedNode\MediaFolder", required=false
)
@Rest\Security("is_fully_authenticated() & has_role('ROLE_API_USER')")
Get collection of media folder