Browse code

Created repository.

DoubleBastionAdmin authored on 01/03/2022 23:31:10
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,28 @@
1
+<?php
2
+
3
+namespace Phaxio\Fax;
4
+
5
+class File extends \ArrayObject
6
+{
7
+    private $phaxio;
8
+    private $fax_id;
9
+
10
+    public function __construct($phaxio, $fax_id) {
11
+        $this->setFlags(\ArrayObject::ARRAY_AS_PROPS);
12
+        $this->phaxio = $phaxio;
13
+        $this->fax_id = $fax_id;
14
+    }
15
+
16
+    public function delete() {
17
+        $this->phaxio->doRequest("DELETE", 'faxes/' . urlencode($this->fax_id) . '/file');
18
+
19
+        return true;
20
+    }
21
+
22
+    public function retrieve($params = array()) {
23
+        $result = $this->phaxio->doRequest("GET", 'faxes/' . urlencode($this->fax_id) . '/file', $params, false);
24
+        $this->exchangeArray($result);
25
+
26
+        return $this;
27
+    }
28
+}