Skip to content

Instantly share code, notes, and snippets.

@frazr
Created February 12, 2016 10:09
Show Gist options
  • Save frazr/248173591de8c5193c07 to your computer and use it in GitHub Desktop.
Save frazr/248173591de8c5193c07 to your computer and use it in GitHub Desktop.
$company = $this->Companies->find()->where(['Companies.id' => $id])->contain(['ArticleGroups','Locations'])->first();
if ($this->request->is(['patch', 'post', 'put'])) {
$company = $this->Companies->patchEntity($company, $this->request->data);
if ($this->Companies->save($company)) {
$this->Flash->success(__('The company has been saved.'));
} else {
$this->Flash->error(__('The company could not be saved. Please, try again.'));
}
}
debug($company);
die();
$company = $this->paginate($company->locations);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment