public function retrieveByPartialHeadline($query)
    {
        $query = $this->createQueryBuilder('q')
            ->select('q.id, q.headline')
            ->where('q.headline LIKE :query')
            ->orderBy('q.publishAt', 'DESC')
            ->setParameter('query','%'.$query.'%')
            ->getQuery();

        return $query->getArrayResult();
    }
public function retrieveByPartialHeadline($query)
    {
        $query = $this->createQueryBuilder('q')
            ->select('q.id, q.headline')
            ->where('q.headline LIKE :query')
            ->orderBy('q.publishAt', 'DESC')
            ->setParameter('query','%'.$query.'%')
            ->getQuery();

        return $query->getArrayResult();
    }
public function retrieveByPartialHeadline ( $ query ) { $ query = $ this -> createQueryBuilder ( 'q' ) -> select ( 'q.id, q.headline' ) -> where ( 'q.headline LIKE :query' ) -> orderBy ( 'q.publishAt' , 'DESC' ) -> setParameter ( 'query' , '%' . $ query . '%' ) -> getQuery ( ) ; return $ query -> getArrayResult ( ) ; }
used for autocomplete in admin

@param string $query

@return array
used for autocomplete in admin