View Single Post
  #3  
Old 03-12-2018, 04:43 AM
 
Soptareanu Alex Soptareanu Alex is offline
 

Member
  
Join Date: Sep 2016
Posts: 24
 

Default Re: Query Builder in Xcart

Quote:
Originally Posted by tony_sologubov
Your request should be as follows:
Code:
$aBackOrders = \XLite\Core\Database::getRepo('\XLite\Model\Order') ->createQueryBuilder('o') ->andWhere('o.shippingStatus = :id') ->setParameter('id', 4) ->getResult();

Doctrine only works with properties in model class (in your case \XLite\Model\Order) and there is no property called 'shipping_status_id'. Instead you should work with 'shippingStatus' property and you can specify its value as ID (in my example) or as an entire \XLite\Model\Order\Status\Shipping object.

Please, let me know if it helps.

Tony
Yes ! It works. Thanks very much for the advice !
__________________
alex
Reply With Quote