Passed
Push — main ( ae0975...11438a )
by Dylan
02:15
created

Order::getSaveURL()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Lifeboat\Models;
4
5
use Lifeboat\Exceptions\ApiException;
6
use Lifeboat\Exceptions\OAuthException;
7
8
/**
9
 * Class Order
10
 * @package Lifeboat\Models
11
 *
12
 * @property string $Status
13
 * @property string $Fulfillment
14
 * @property string|null $DiscountCode
15
 * @property \DateTime $Created
16
 * @property \DateTime $LastModified
17
 * @property
18
 */
19
class Order extends Model {
20
21
    protected static array $casting = [
22
        'Created'       => 'lifeboat_date_formatter',
23
        'LastModified'  => 'lifeboat_date_formatter'
24
    ];
25
26
    /**
27
     * @see Model::write()
28
     *
29
     * @return Order|null
30
     * @throws ApiException
31
     * @throws OAuthException
32
     */
33
    public function save(): ?Order
34
    {
35
        /** @var Order|null $order */
36
        $order = $this->write('api/orders/order/' . $this->ID);
37
        return $order;
38
    }
39
}
40