public function search(string $string, string $resources = ''): array
    {
        $query = $this->getRepository('Search')
            ->query()
            ->setParameter('query', $string);
        if ($resources) {
            $query->setParameter('resources', \mb_strtolower($resources));
        }

        return $query->find();
    }
public function search(string $string, string $resources = ''): array
    {
        $query = $this->getRepository('Search')
            ->query()
            ->setParameter('query', $string);
        if ($resources) {
            $query->setParameter('resources', \mb_strtolower($resources));
        }

        return $query->find();
    }
public function search ( string $ string , string $ resources = '' ) : array { $ query = $ this -> getRepository ( 'Search' ) -> query ( ) -> setParameter ( 'query' , $ string ) ; if ( $ resources ) { $ query -> setParameter ( 'resources' , \ mb_strtolower ( $ resources ) ) ; } return $ query -> find ( ) ; }
Shortcut for searching.

@param string $string
@param string $resources

@return array
Shortcut for searching .