I have and Entity : Company, which has a column: Type.
Type can either be a string, or an array of strings.
Ex: Type can be "Foo", "Bar", or array("Foo", "Bar").
I can't figure how to get all the Companies where the type contains "Bar".
I tried
$qb = $this->companyRepository()->createQueryBuilder("c");
$companies = $qb
->select("c")
->Where( $qb->expr()->in('c.type', array($qb->expr()->literal('Bar'))))
->getQuery()
->getResult();
Which only fetch the Companies where the type is "Bar", and not the ones where it is array("Foo", "Bar").
I tried $qb->expr()->like(...) instead of $qb->expr()->in(..) with the same results.
How can I get Companies where the type contains "Bar"? (Assuming type has more than just the 3 values I gave as an example)