Hello,
I’m starting to get my application to work. However, I have this question:
I have a bank account entity with transactions.
I want to retrieve a specific bank account, and retrieve the last 15 transactions.
How can I limit the number of transactions retrieved?
Here’s my code now:
$bankAccount = $this->BankAccounts->get($id, [
'contain' => [
'Users',
'Transactions' => ['sort' => ['Transactions.created' => 'DESC']]]
]);
I tried putting ‘limit’ => 15 in the Transactions part of the array, but that threw an error.