Found a possible solution but not the optimal one is to use a like expr:
$qb->add($qb->expr()->like("i.capacity", $qb->expr()->literal("%text_to_search%")));
And after work in memory with Doctrine Criteria.
Question
It possible to create a query for columns type => object on doctrine 2?
Domain question in:
Example
/**
*
* Capacity Object Details
* wgross = weight of item, wnet = neto weight
*
* @ORM\Column(type="object")
*/
private $capacity;
When:
$capacity = array('wgross' => 19, 'wnet' => 9);
Possible query with pseudo where:
$em->createQuery('SELECT i FROM Entity\Item i WHERE i.capacity.wnet < 18');
Doctrine serialize the object type, i search on the web for possible solutions with:
The type of columns on RDMS is longtext and not clob or blob, with value something like this.
O:8:"stdClass":5:{s:4:"wgross";s:0:"19";s:6:"wnet";s:0:"9";}
But nothing found.
Solution
Found a possible solution but not the optimal one is to use a like expr:
$qb->add($qb->expr()->like("i.capacity", $qb->expr()->literal("%text_to_search%")));
And after work in memory with Doctrine Criteria.