title: Symfony2 Undefined method 'findLikeFullnameArray'. The method name must start with either findBy or findOneBy
body: <p>I have read through various solutions for this issue but none seem to work. I really want to know what is at the heart of this issue. I am going to list exactly what I did since it is relatively simple and I can't understand what I am missing. </p>
  
  <p>So I have created a simple database with a table person and I am trying to generate CRUD with bootstrap which I get working fine. My issue is when I try to get jquery plugin to work with autocomplete. Next thing I add a repository to handle my query and that's when I get the Symfony2 Undefined method 'findLikeFullnameArray' message. I am trying to use just annotations so if there is something wrong in my process please let me know.</p>
  
  <p>Here are my commands:
  Create Bundle</p>
  
  <ol>
  <li>app/console generate:bundle --bundle-name=CompanyNameofBundle --format=annotation</li>
  <li>Bundle namespace: Company/nameofBundle</li>
  <li>Do you want to generate the whole directory structure: yes</li>
  <li>Do you confirm generation: return</li>
  <li>Confirm automatic update of your Kernel: yes</li>
  <li>Confirm automatic update of the Routing: yes</li>
  </ol>
  
  <p>Create entities with crud</p>
  
  <ol>
  <li>app/console generate:bundle --bundle-name=CompanyNameofBundle --format=annotation
      Bundle namespace: Company/nameofBundle
      Do you want to generate the whole directory structure: yes
      Do you confirm generation: return
      Confirm automatic update of your Kernel: yes
      Confirm automatic update of the Routing: yes</li>
  <li>app/console doctrine:mapping:import --force CompanyNameofBundle  xml</li>
  <li>app/console doctrine:generate:entities  CompanyNameofBundle</li>
  <li>app/console generate:doctrine:crud –entity=CompanyNameofBundle:Entityname --format=annotation --with-write –no-interaction</li>
  </ol>
  
  <p>I then create my SearchController:</p>
  
  <pre><code>namespace Company\NameofBundle\Controller;
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  use Company\NameofBundle\Form\JqueryType;
  use Company\NameofBundle\Form\SearchType;
  use Symfony\Component\HttpFoundation\Response;
  use Symfony\Component\HttpFoundation\JsonResponse;
  use Symfony\Component\HttpFoundation\Request;
  use Company\NameofBundle\Entity\Person;
  
  
  /**
   * Search controller.
   *
   * @Route("/search")
   */
  class SearchController extends Controller
  {
      /**
       * @Route("/", name="search")
       * @Template()
       */
      public function indexAction()
      {
          $form   = $this-&gt;createForm(new SearchType(), null, [
              'action' =&gt; '',
              'method' =&gt; 'POST'
          ]);
          return array(
              'form'   =&gt; $form-&gt;createView(),
          );
      }
      /**
       * @Route("/person_search", name="person_search")
       * @Template()
       *
       * @param Request $request
       *
       * @return array
       */
      public function searchPersonAction(Request $request)
      {
          $q = $request-&gt;get('term');
          $em = $this-&gt;getDoctrine()-&gt;getManager();
          $results = $em-&gt;getRepository('CompanyNameofBundle:Person')-&gt;findLikeFullname($q);
          return array('results' =&gt; $results);
      }
  
      /**
       * @Route("/person_get", name="person_get")
       *
       * @param $id
       *
       * @return Response
       */
      public function getPersonAction($id)
      {
          $em = $this-&gt;getDoctrine()-&gt;getManager();
          $book = $em-&gt;getRepository('CompanyNameofBundle:Person')-&gt;find($id);
          return new Response($book-&gt;getFullname());
      }
      /**
       * @Route("/jquery", name="jquery")
       * @Template()
       */
      public function jqueryAction()
      {
          $form   = $this-&gt;createForm(new JqueryType(), null, [
              'action' =&gt; '',
              'method' =&gt; 'POST'
          ]);
          return array(
              'form'   =&gt; $form-&gt;createView(),
          );
      }
      /**
       * @Route("/jquery_search/{phrase}", name="jquery_search")
       *
       * @param string $phrase
       *
       * @return JsonResponse
       */
      public function searchJqueryAction($phrase)
      {
          $em = $this-&gt;getDoctrine()-&gt;getManager();
          $results = $em-&gt;getRepository('CompanyNameofBundle:Person')-&gt;findLikeFullnameArray($phrase);
          return new JsonResponse($results);
      }
  }
  </code></pre>
  
  <p>Person Entity:</p>
  
  <pre><code>&lt;?php
  
  namespace Company\NameofBundle\Person;
  
  use Doctrine\ORM\Mapping as ORM;
  
  /**
   * Person
   * @ORM\Table()
   * @ORM\Entity(repositoryClass="Company\NameofBundle\Entity\Repository\PersonRepository")
   */
  class Person
  
  {
      /**
       * @var integer
       *
       * @ORM\Column(name="id", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      private $id;
      /**
       * @var string
       *
       * @ORM\Column(name="fullname", type="string", length=255)
       */
      private $fullname;
      /**
       * @var string
       *
       * @ORM\Column(name="email", type="string", length=255)
       */
      private $email;
      /**
       * Get id
       *
       * @return integer
       */
      public function getId()
      {
          return $this-&gt;id;
      }
      /**
       * Set fullname
       *
       * @param string $fullname
       * @return Person
       */
      public function setFullname($fullname)
      {
          $this-&gt;fullname = $fullname;
          return $this;
      }
      /**
       * Get fullname
       *
       * @return string
       */
      public function getFullname()
      {
          return $this-&gt;fullname;
      }
      /**
       * Set email
       *
       * @param string $email
       * @return Person
       */
      public function setEmail($email)
      {
          $this-&gt;email = $email;
          return $this;
      }
      /**
       * Get email
       *
       * @return string
       */
      public function getEmail()
      {
          return $this-&gt;email;
      }
  }
  </code></pre>
  
  <p>Lastly PersonRepository</p>
  
  <pre><code>&lt;?php
  
  namespace Company\NameofBundle\Entity\Repository;
  use Doctrine\ORM\EntityRepository;
  
  class PersonRepository extends EntityRepository
  {
  
      public function findLikeFullnameArray($fullname)
      {
          return $this-&gt;createQueryBuilder('person_repository')
              -&gt;where('person_repository.fullname LIKE :name')
              -&gt;setParameter('name', '%' . $fullname . '%')
              -&gt;getQuery()
              -&gt;getArrayResult();
      }
  }
  </code></pre>
  
  <p>In just in case here is my app/config/routing.yml</p>
  
  <pre><code>company_nameofbundle:
      resource: "@CompanyNameofBundle/Controller/"
      type:     annotation
      prefix:   /
  </code></pre>
  
  <p>Thanks in advance!</p>