Created
May 27, 2017 13:38
-
-
Save joshuaso91/efbd18e7be5554f15b09f23a34e67e0d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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