Cakephp Query Builder

Below is my query. I attached the image for the error i get .

$settings = $this->Savings->find();

$settings->select([

  'Savings.id',

  'Savings.code',

  'Savings.ssa',

  'Savings.saving_type_id',

  'Savings.terms'])

  ->contain(['SavingSubs' => function(Query $q) {
    return $q->autoFields(true);
}])

  ->where($conditions);

Time to read up a bit on PHP namespaces! Your function(Query) is interpreting Query as being in your current namespace (App\Controller\Api). You need to either specify the fully qualified name Cake\ORM\Query in your function prototype, or else use Cake\ORM\Query; at the top of your file.

It is working now . Thank you
My apologies .

I’ve always used my own query builder but I’m tired of maintaining it. I’m now looking to try a new query builder library. Currently looking at these:

What do you recommend from these? Or do you recommend something else??

This site is for discussing CakePHP. If you have questions about the Cake ORM, we can help. But this is not likely to be a good place to get much in the way of unbiased opinions about the rest.