Advertisement
Arckios

Untitled

Mar 14th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1.     public function indexPublic($id)
  2.     {
  3.  
  4.         if($this->Auth->user()){
  5.             $owner = $this->ServiceCategories->Enterprises->get($id)->owner_id;
  6.             $hisEnterprise = $this->ServiceCategories->Enterprises->findByOwner_id($this->Auth->user('id'))->last()->id;
  7.             $this->redirect(['action'=>'index', $hisEnterprise]);
  8.         }else{
  9.             $serviceCategories = $this->ServiceCategories->find('all')->where(['enterprise_id' => $id]);
  10.             $allserv = $serviceCategories->toArray();
  11.             $this->paginate=['limit'=> 6];
  12.             $this->paginate($serviceCategories);
  13.             $this->set(compact('serviceCategories', 'allserv'));
  14.         }
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement