Skip to content

Instantly share code, notes, and snippets.

@joshuaso91
Created May 27, 2017 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshuaso91/efbd18e7be5554f15b09f23a34e67e0d to your computer and use it in GitHub Desktop.
Save joshuaso91/efbd18e7be5554f15b09f23a34e67e0d to your computer and use it in GitHub Desktop.
public function addSupplierProducts()
{
$priceCheck = $this->PriceChecks->newEntity();
if ($this->request->is('post')) {
debug($this->request->getData());exit;
$priceCheck = $this->PriceChecks->patchEntity($priceCheck, $this->request->getData());
if ($this->PriceChecks->save($priceCheck)) {
$this->Flash->success(__('The price check has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The price check could not be saved. Please, try again.'));
}
$suppliers = $this->PriceChecks->Suppliers->find('list');
$products = $this->PriceChecks->Products->find('list');
$this->set(compact('priceCheck', 'suppliers', 'products'));
$this->set('_serialize', ['priceCheck']);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment