Is there any difference when using contain
or loadModel
in terms of speed and/or resources?
For example:
$transaction = $this->Transactions->get($id, [
'contain' => ['Customers']
]);
$customer_name = $transaction->customer->name
VS
$this->loadModel('Customers');
$transaction = $this->Transactions->get($id);
$customer_name = ($this->Customers->get($transaction->customer_id))->name;