Reputation: 4356
Is there any function to unbind
all associative Models before find()
in CakePHP?
$this->Model1->unbindModel(array('hasMany'=>array('Model2'),'belongsTo'=>array('Model3')));
I want to get result from Model1
only. But as I have many models, so I don't want to use unbindModel
like this separately.
Upvotes: 0
Views: 2478
Reputation: 4776
Simply set the model recursive to -1
$this->ModelName->recursive = -1;
$assets = $this->ModelName->find('all');
debug($assets);
Upvotes: 5