I have query:
$Query = $this->UsersDocuments->find()->select([
'UsersDocuments.id',
'UsersDocuments.order_number',
])
->contain([
'UsersDocumentsOrders',
'UsersDocumentsItems'
]);
$Content = $this->paginate($Query);
I need to calculate the sum of the items in the UsersDocumentsItems table that is assigned to the UsersDocuments table. Will there be any function in the contain?
Thank you