| Line 18... |
Line 18... |
| 18 |
public function beforeFilter() {
|
18 |
public function beforeFilter() {
|
| 19 |
parent::beforeFilter();
|
19 |
parent::beforeFilter();
|
| 20 |
$this->Auth->allow('update','by','rem');
|
20 |
$this->Auth->allow('update','by','rem');
|
| 21 |
}
|
21 |
}
|
| 22 |
|
22 |
|
| - |
|
23 |
public function mine() {
|
| - |
|
24 |
$this->layout = "innerpages";
|
| - |
|
25 |
$this->UserAction->Behaviors->attach('Containable');
|
| - |
|
26 |
$contain = array('StoreProduct.title','StoreProduct.thumbnail','StoreProduct.mrp','StoreProduct.available_price');
|
| - |
|
27 |
$options = array('contain'=>$contain,'conditions'=>array('UserAction.user_id'=>$this->Auth->User('id'),'UserAction.action'=>'like'));
|
| - |
|
28 |
$myfavorites = $this->UserAction->find('all',$options);
|
| - |
|
29 |
$this->set(compact(myfavorites));
|
| - |
|
30 |
}
|
| - |
|
31 |
|
| 23 |
public function update($user_id,$store_product_id,$action) {
|
32 |
public function update($user_id,$store_product_id,$action) {
|
| 24 |
if(!empty($user_id) && !empty($store_product_id) && !empty($action)) {
|
33 |
if(!empty($user_id) && !empty($store_product_id) && !empty($action)) {
|
| 25 |
$data = array('user_id'=>$user_id,'store_product_id'=>$store_product_id);
|
34 |
$data = array('user_id'=>$user_id,'store_product_id'=>$store_product_id);
|
| 26 |
$this->UserAction->deleteAll(array($data),false);
|
35 |
$this->UserAction->deleteAll(array($data),false);
|
| 27 |
$this->response->type('json');
|
36 |
$this->response->type('json');
|