Subversion Repositories SmartDukaan

Rev

Rev 14098 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14098 Rev 15848
Line 202... Line 202...
202
 * @throws NotFoundException
202
 * @throws NotFoundException
203
 * @param string $id
203
 * @param string $id
204
 * @return void
204
 * @return void
205
 */
205
 */
206
	public function admin_delete($id = null) {
206
	public function admin_delete($id = null) {
207
		$this->CategoryDiscount->id = $id;
-
 
208
		if (!$this->CategoryDiscount->exists()) {
-
 
209
			throw new NotFoundException(__('Invalid category discount'));
-
 
210
		}
-
 
211
		$this->request->onlyAllow('post', 'delete');
-
 
212
		if ($this->CategoryDiscount->delete()) {
207
		if ($this->remove($id,'CategoryDiscount')) {
213
			$this->Session->setFlash(__('The category discount has been deleted.'));
208
			$this->Session->setFlash(__('The sku scheme deal has been deleted.'));
214
		} else {
209
		} else {
215
			$this->Session->setFlash(__('The category discount could not be deleted. Please, try again.'));
210
			$this->Session->setFlash(__('The sku scheme could not be deleted. Please, try again.'));
216
		}
211
		}
217
		return $this->redirect(array('action' => 'index'));
212
		return $this->redirect(array('action' => 'index'));
218
	}}
213
	}
-
 
214
}