This is probably a dumb question, but I can't find a definitive answer anywhere. Is it possible to access model data in a Controller, and if so, how?
I tried the following:
$this->set('mydata', $this->Model->find('all', 'conditions' => array('id' => 'someID')));
And accessing it via this in the controller:
$mydata['Model']['field']
But that appears to only be for the views.
Is there a way to access the model data in the controller? The reason is that I need to perform calculations on an associated model (belongsTo) that can't be done via hidden fields or anything because the ID of the associated model isn't passed until after the form is submitted.
Any help would be greatly appreciated!