Completed
Push — master ( cf1e67...08c142 )
by ARCANEDEV
11s
created

SubscriptionItem::retrieve()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php namespace Arcanedev\Stripe\Resources;
2
3
use Arcanedev\Stripe\Contracts\Resources\SubscriptionItem as SubscriptionItemContract;
4
use Arcanedev\Stripe\StripeResource;
5
6
/**
7
 * Class     SubscriptionItem
8
 *
9
 * @package  Arcanedev\Stripe\Resources
10
 * @author   ARCANEDEV <[email protected]>
11
 *
12
 * @property  string                            id
13
 * @property  string                            object   // 'subscription_item'
14
 * @property  int                               created
15
 * @property  \Arcanedev\Stripe\Resources\Plan  plan
16
 * @property  int                               quantity
17
 */
18
class SubscriptionItem extends StripeResource implements SubscriptionItemContract
19
{
20
    /* ------------------------------------------------------------------------------------------------
21
     |  Getters & Setters
22
     | ------------------------------------------------------------------------------------------------
23
     */
24
    /**
25
     * Get The name of the class, with namespacing and underscores stripped.
26
     *
27
     * @param  string  $class
28
     *
29
     * @return string
30
     */
31
    public static function className($class = '')
32
    {
33
        return 'subscription_item';
34
    }
35
36
    /* ------------------------------------------------------------------------------------------------
37
     |  Main Functions
38
     | ------------------------------------------------------------------------------------------------
39
     */
40
    /**
41
     * List all Subscription items.
42
     *
43
     * @param  array|null         $params
44
     * @param  array|string|null  $options
45
     *
46
     * @return \Arcanedev\Stripe\Collection|array
47
     */
48 2
    public static function all($params = null, $options = null)
49
    {
50 2
        return self::scopedAll($params, $options);
51
    }
52
53
    /**
54
     * Retrieve a Subscription item.
55
     *
56
     * @param  string             $id
57
     * @param  array|string|null  $options
58
     *
59
     * @return self
60
     */
61 2
    public static function retrieve($id, $options = null)
62
    {
63 2
        return self::scopedRetrieve($id, $options);
64
    }
65
66
    /**
67
     * Create a Subscription item.
68
     *
69
     * @param  array|null         $params
70
     * @param  array|string|null  $options
71
     *
72
     * @return self
73
     */
74 2
    public static function create($params = null, $options = null)
75
    {
76 2
        return self::scopedCreate($params, $options);
77
    }
78
79
    /**
80
     * Update a Subscription item.
81
     *
82
     * @param  string             $id
83
     * @param  array|null         $params
84
     * @param  array|string|null  $options
85
     *
86
     * @return self
87
     */
88 2
    public static function update($id, $params = null, $options = null)
89
    {
90 2
        return self::scopedUpdate($id, $params, $options);
91
    }
92
93
    /**
94
     * Save a Subscription item.
95
     *
96
     * @param  array|string|null  $options
97
     *
98
     * @return self
99
     */
100 2
    public function save($options = null)
101
    {
102 2
        return $this->scopedSave($options);
103
    }
104
105
    /**
106
     * Delete a Subscription item.
107
     *
108
     * @param  array|null         $params
109
     * @param  array|string|null  $options
110
     *
111
     * @return self
112
     */
113 2
    public function delete($params = null, $options = null)
114
    {
115 2
        return $this->scopedDelete($params, $options);
116
    }
117
}
118