In cakePHP 1.3 we used this method to set the association limit records
'BuyRate' => array(
'className' => 'Rate',
'foreignKey' => 'currency_id',
'dependent' => true,
'conditions' => array('BuyRate.sale_method_id' => '1', 'BuyRate.payment_method_id' => '3'),
'order' => array('BuyRate.id'=>'DESC'),
'limit' => '1'
),
Now in CakePHP 4, we are using the following method to set the limit in records but the association limit did not set.
$this->hasMany('SellRate', [
'className' => 'Rates',
'foreignKey' => 'currency_id',
'dependent' => true,
'conditions' => array('SellRate.sale_method_id' => '2'),
'propertyName' => 'sell_rate',
'limit' => 1
]);
How can I set the records limit in CakePHP 4 new version???