Find don't work.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • krmn.msg
    Member
    • Jun 2016
    • 36

    Find don't work.

    Hi,

    I am using version 4.2.4. and when I try use these:
    $account = $entityManager->getRepository('Account')->where(array( 'type' => 'Customer', ))->findOne(); doesn't function. It doesn't return account. I was tried different examples, and I am sure that elements are in database. Before, I was worked with 4.1.5. and in this version functioned. Thanks.
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    $this->getEntityManager()->...., not $entityManager->

    Comment

    • krmn.msg
      Member
      • Jun 2016
      • 36

      #3
      Yes, I was used that. I have $entityManager = $this->getEntityManager(), but neither forms works for me. Other idea? Any reason?

      Comment

      • tanya
        Senior Member
        • Jun 2014
        • 4308

        #4
        I ran this code and it worked. Attach the file and write the path

        Comment

        Working...