@@ -14,47 +14,47 @@ |
||
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | // Retorna a listagem de notificações |
| 17 | - public function getAll(array $filtros){ |
|
| 17 | + public function getAll(array $filtros) { |
|
| 18 | 18 | $filtro = ''; |
| 19 | - if(is_array($filtros)){ |
|
| 20 | - if($filtros){ |
|
| 21 | - foreach($filtros as $key => $f){ |
|
| 22 | - if(!empty($f)){ |
|
| 23 | - if($filtro){ |
|
| 19 | + if (is_array($filtros)) { |
|
| 20 | + if ($filtros) { |
|
| 21 | + foreach ($filtros as $key => $f) { |
|
| 22 | + if (!empty($f)) { |
|
| 23 | + if ($filtro) { |
|
| 24 | 24 | $filtro .= '&'; |
| 25 | 25 | } |
| 26 | - $filtro .= $key.'='.$f; |
|
| 26 | + $filtro .= $key . '=' . $f; |
|
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | - $filtro = '?'.$filtro; |
|
| 29 | + $filtro = '?' . $filtro; |
|
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | - return $this->http->get('/notifications'.$filtro); |
|
| 32 | + return $this->http->get('/notifications' . $filtro); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | // Retorna os dados da notificação de acordo com o Id |
| 36 | - public function getById($id){ |
|
| 37 | - return $this->http->get('/notifications/'.$id); |
|
| 36 | + public function getById($id) { |
|
| 37 | + return $this->http->get('/notifications/' . $id); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | // Retorna a listagem de notificações de acordo com o Id do Cliente |
| 41 | - public function getByCustomer($customer_id){ |
|
| 42 | - return $this->http->get('/customers/'.$customer_id.'/notifications'); |
|
| 41 | + public function getByCustomer($customer_id) { |
|
| 42 | + return $this->http->get('/customers/' . $customer_id . '/notifications'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | // Insere uma nova notificação |
| 46 | - public function create(array $dadosNotificacao){ |
|
| 46 | + public function create(array $dadosNotificacao) { |
|
| 47 | 47 | return $this->http->post('/notifications', $dadosNotificacao); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | // Atualiza os dados da notificação |
| 51 | - public function update($id, array $dadosNotificacao){ |
|
| 51 | + public function update($id, array $dadosNotificacao) { |
|
| 52 | 52 | return $this->http->post('/notifications', $dadosNotificacao); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | // Deleta uma notificação |
| 56 | - public function delete($id){ |
|
| 57 | - return $this->http->get('/notifications/'.$id,'','DELETE'); |
|
| 56 | + public function delete($id) { |
|
| 57 | + return $this->http->get('/notifications/' . $id, '', 'DELETE'); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | } |