Bundle/ViewReferenceBundle/Connector/ViewReferenceRepository.php
public function getReferencesByParameters(array $parameters, $transform = true, $keepChildren = false, $type = null)
    {
        $viewsReferences = [];
        $refsId = $this->repository->getAllBy($parameters, $type);

        $references = $this->repository->getResults($refsId);
        foreach ($references as $reference) {
            if ($transform === true) {
                $transformViewReferenceFn = function ($parentViewReference) use (&$transformViewReferenceFn, $keepChildren) {
                    $transformer = ViewReferenceManager::findTransformerFromElement($parentViewReference);
                    $reference = $transformer->transform($parentViewReference);
                    if ($keepChildren) {
                        foreach ($this->repository->getChildren($parentViewReference['id']) as $child) {
                            $reference->addChild($transformViewReferenceFn($this->repository->findById($child)));
                        }
                    }

                    return $reference;
                };

                $reference = $transformViewReferenceFn($reference);
            }
            $viewsReferences[] = $reference;
        }

        return $viewsReferences;
    }
public function getReferencesByParameters(array $parameters, $transform = true, $keepChildren = false, $type = null)
    {
        $viewsReferences = [];
        $refsId = $this->repository->getAllBy($parameters, $type);

        $references = $this->repository->getResults($refsId);
        foreach ($references as $reference) {
            if ($transform === true) {
                $transformViewReferenceFn = function ($parentViewReference) use (&$transformViewReferenceFn, $keepChildren) {
                    $transformer = ViewReferenceManager::findTransformerFromElement($parentViewReference);
                    $reference = $transformer->transform($parentViewReference);
                    if ($keepChildren) {
                        foreach ($this->repository->getChildren($parentViewReference['id']) as $child) {
                            $reference->addChild($transformViewReferenceFn($this->repository->findById($child)));
                        }
                    }

                    return $reference;
                };

                $reference = $transformViewReferenceFn($reference);
            }
            $viewsReferences[] = $reference;
        }

        return $viewsReferences;
    }
public function getReferencesByParameters ( array $ parameters , $ transform = true , $ keepChildren = false , $ type = null ) { $ viewsReferences = [ ] ; $ refsId = $ this -> repository -> getAllBy ( $ parameters , $ type ) ; $ references = $ this -> repository -> getResults ( $ refsId ) ; foreach ( $ references as $ reference ) { if ( $ transform === true ) { $ transformViewReferenceFn = function ( $ parentViewReference ) use ( & $ transformViewReferenceFn , $ keepChildren ) { $ transformer = ViewReferenceManager :: findTransformerFromElement ( $ parentViewReference ) ; $ reference = $ transformer -> transform ( $ parentViewReference ) ; if ( $ keepChildren ) { foreach ( $ this -> repository -> getChildren ( $ parentViewReference [ 'id' ] ) as $ child ) { $ reference -> addChild ( $ transformViewReferenceFn ( $ this -> repository -> findById ( $ child ) ) ) ; } } return $ reference ; } ; $ reference = $ transformViewReferenceFn ( $ reference ) ; } $ viewsReferences [ ] = $ reference ; } return $ viewsReferences ; }
Get references matching with parameters.

@param $parameters
@param bool|true  $transform
@param bool|false $keepChildren

@return array
Get references matching with parameters .