| Total Complexity | 7 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class StatementForwardingHandler extends APIHandler { |
||
| 8 | |||
| 9 | private $statement_forwarding = '/statementforwarding'; |
||
| 10 | private $api = '/api'; |
||
| 11 | private $v1 = '/v1'; |
||
|
|
|||
| 12 | private $v2 = '/v2'; |
||
| 13 | |||
| 14 | protected $headers = [ |
||
| 15 | 'Content-Type' => 'application/json' |
||
| 16 | ]; |
||
| 17 | |||
| 18 | function __construct($id = null) { |
||
| 19 | parent::__construct(); |
||
| 20 | $this->id = $id; |
||
| 21 | } |
||
| 22 | |||
| 23 | |||
| 24 | /** |
||
| 25 | * Learning Locker: Request Organisation Details |
||
| 26 | * |
||
| 27 | * @return $response |
||
| 28 | */ |
||
| 29 | public function get() { |
||
| 30 | try { |
||
| 31 | $url = $this->url . $this->api . $this->v2 . $this->statement_forwarding . '/' . $this->id ?? $this->id; |
||
| 32 | $response = $this->request($url); |
||
| 33 | return $response; |
||
| 34 | } catch (Exception $e) { |
||
| 35 | return $e; |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Learning Locker: Request Organisation Details |
||
| 41 | * |
||
| 42 | * @return $response |
||
| 43 | */ |
||
| 44 | public function update($data) { |
||
| 45 | try { |
||
| 46 | $url = $this->url . $this->api . $this->v2 . $this->statement_forwarding . '/' . $this->id ?? $this->id; |
||
| 47 | $response = $this->save($url, $data); |
||
| 48 | return $response; |
||
| 49 | } catch (Exception $e) { |
||
| 50 | return $e; |
||
| 51 | } |
||
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Learning Locker: Request Organisation Details |
||
| 56 | * |
||
| 57 | * @return $response |
||
| 58 | */ |
||
| 59 | public function create($data = null) { |
||
| 66 | } |
||
| 67 | } |
||
| 68 | } |
||
| 69 |