php - How to create a query builder on object property in doctrine 2 -


it possible create query columns type => object on doctrine 2?

domain question in:

  • query builder
  • dql

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 pseudo where:

$em->createquery('select entity\item i.capacity.wnet < 18'); 

doctrine serialize object type, search on web possible solutions with:

  • doctrine query builder expr
  • regular expression

the type of columns on rdms longtext , not clob or blob, value this.

o:8:"stdclass":5:{s:4:"wgross";s:0:"19";s:6:"wnet";s:0:"9";} 

but nothing found.

found possible solution not optimal 1 use expr:

 $qb->add($qb->expr()->like("i.capacity", $qb->expr()->literal("%text_to_search%"))); 

and after work in memory doctrine criteria.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -