| Total Complexity | 12 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 6 | class Notificacao { |
||
| 7 | // |
||
| 8 | |||
| 9 | public $http; |
||
| 10 | |||
| 11 | public function __construct(Connection $connection) |
||
| 12 | { |
||
| 13 | $this->http = $connection; |
||
| 14 | } |
||
| 15 | |||
| 16 | // Retorna a listagem de notificações |
||
| 17 | public function getAll(array $filtros){ |
||
| 18 | $filtro = ''; |
||
| 19 | if(is_array($filtros)){ |
||
|
|
|||
| 20 | if($filtros){ |
||
| 21 | foreach($filtros as $key => $f){ |
||
| 22 | if(!empty($f)){ |
||
| 23 | if($filtro){ |
||
| 24 | $filtro .= '&'; |
||
| 25 | } |
||
| 26 | $filtro .= $key.'='.$f; |
||
| 27 | } |
||
| 28 | } |
||
| 29 | $filtro = '?'.$filtro; |
||
| 30 | } |
||
| 31 | } |
||
| 32 | return $this->http->get('/notifications'.$filtro); |
||
| 33 | } |
||
| 34 | |||
| 35 | // Retorna os dados da notificação de acordo com o Id |
||
| 36 | public function getById($id){ |
||
| 37 | return $this->http->get('/notifications/'.$id); |
||
| 38 | } |
||
| 39 | |||
| 40 | // Retorna a listagem de notificações de acordo com o Id do Cliente |
||
| 41 | public function getByCustomer($customer_id){ |
||
| 43 | } |
||
| 44 | |||
| 45 | // Insere uma nova notificação |
||
| 46 | public function create(array $dadosNotificacao){ |
||
| 47 | return $this->http->post('/notifications', $dadosNotificacao); |
||
| 48 | } |
||
| 49 | |||
| 50 | // Atualiza os dados da notificação |
||
| 51 | public function update($id, array $dadosNotificacao){ |
||
| 53 | } |
||
| 54 | |||
| 55 | // Deleta uma notificação |
||
| 56 | public function delete($id){ |
||
| 58 | } |
||
| 59 | |||
| 60 | } |
||
| 61 |