Conditions | 1 |
Paths | 1 |
Total Lines | 8 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
54 | public function create (string $file) { |
||
55 | // api returns compact version. reload. |
||
56 | $remote = $this->api->call('POST', "{$this->getParent()}/attachments", [ |
||
57 | CURLOPT_POSTFIELDS => ['file' => new CURLFile(realpath($file))] // multipart/form-data |
||
58 | ])['data']; |
||
59 | $this->data['gid'] = $remote['gid']; |
||
60 | $this->reload(); |
||
61 | return $this; |
||
62 | } |
||
63 | } |