Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function indexPublic($id)
- {
- if($this->Auth->user()){
- $owner = $this->ServiceCategories->Enterprises->get($id)->owner_id;
- $hisEnterprise = $this->ServiceCategories->Enterprises->findByOwner_id($this->Auth->user('id'))->last()->id;
- $this->redirect(['action'=>'index', $hisEnterprise]);
- }else{
- $serviceCategories = $this->ServiceCategories->find('all')->where(['enterprise_id' => $id]);
- $allserv = $serviceCategories->toArray();
- $this->paginate=['limit'=> 6];
- $this->paginate($serviceCategories);
- $this->set(compact('serviceCategories', 'allserv'));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement