I came across a particular piece of cake 2 code in which the “where” clause accepts an array of values for a “greater than or equals to” (>=) clause.
Let me illustrate what I am talking about with the code below:
old_cake2.php
// this variable represents amounts due associated with an order
$transaction_amount_due = array(50,120, 39);
$conditions['Order.amount_due'] = '>= ' . $transaction_amounts_due ;
$this->Order->Transaction->find($conditions);
My question, is there a similar convention for cake4 queries?
You are absolutely right! This cake2 code is pretty weird and at times has many of these poorly thought-out logic code pieces. I was still curious if there was any cake4 convention that would handle a query with these parameters automatically (as cake2 appeared to do).