I currently have 2 models. Users and Appbreak. They have associations. Users have many applications. Appbreaks belongs to users. In my appbreak controller there is an approving function that is called when a button is clicked from the watch page.
In this function, I will need to update the value in the appbreak table and the value in the users table. I can update the value in appbreak using the following:
$this->Appbreak->id = $id; $this->Appbreak->set('approve', 'Yes'); $this->Appbreak->save();
However, I cannot get the required data value from the users table. <- it is necessary to do this, since I need to perform some calculations before passing back the calculated value.
Is it possible to get data from another model using the query method? Or do I need to use the find method? If I use the find method, can I update the values ββand save them back to the database?
source share