I'm new at CakePHP and i'm facing some trouble with relationship Models. I have two models with relationship, Employee hasOne
User.
When i use find method, it returns all data from both table.
Example: $this->Employee->find('all');
returns Employee data and User data.
Any idea how to return only Employee data?
Edit
Searching for another question in cakePHP's docs, i found a more properly resolution for this question.
Before use find() method, just place $this-Model->unbindModel()
. Right after use a find() method, the Model will back to association defined as default.
More info here: API CakePHP UnbindModel