Announcement

Collapse
No announcement yet.

ORM query syntax to search a multi-enum

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ORM query syntax to search a multi-enum

    I created an entity with a multi-enum. I can't figure out how to search for records that have a specific value selected. Here is the creation of a record:

    PHP Code:
    $t $this->em->createEntity("Template", array(
        
    "clientId" => $entity->id,
        
    "locations" => ["Clinic""Custom""Daycare"],
    ));
    ​ 
    That works. However, searching for a record that has the word 'Clinic' in it does not work.

    PHP Code:
    $where = array(
      
    "clientId" => "some id",
      
    "locations" => "Clinic",
    );
    $t $this->em->getRDBRepository("Template")->where($where)->findOne();​ 
    Everything I've tried has failed. I can't figure out how to say "find a record with a location that has this value (and any other values).

    What is the syntax to perform a query that says "look for a record with this value in the list of multi-enum values"?

  • #2
    Here it's covered: https://github.com/espocrm/espocrm/issues/2268

    Comment

    Working...
    X