How to make LIKE search by phone from a contact in ORM

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • roman042
    Member
    • Jun 2017
    • 64

    #1

    How to make LIKE search by phone from a contact in ORM


    Hello, tell me how to do a LIKE search by phone from a contact in ORM?

    $contactList = $entityManager->getRepository('Contact')->where(array('LIKE' => 'contact.phoneNumber LIKE "%88888888"'))->limit(0, 200)->find();

    So does not find
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Hello
    you need to use
    PHP Code:
    $contactList $entityManager->getRepository('Contact')->where(['phoneNumber*' => "%8%"])->limit(0200)->find(); 

    Comment

    • roman042
      Member
      • Jun 2017
      • 64

      #3
      Many thanks!!!!!!!!!!!!!!!

      Comment

      • Shuan Paul
        Junior Member
        • Jun 2017
        • 8

        #4
        You will need the php code in the backend.
        $contactList = $entityManager->getRepository('Contact')->where(['phoneNumber*' => "%8%"])->limit(0, 200)->find();

        Comment

        Working...