ReceiptDetail.php
2 years ago
ReceiptDetailCollection.php
2 years ago
ReceiptSettings.php
2 years ago
ReceiptSettings.php
51 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\Framework\Receipts\Properties; |
| 4 | |
| 5 | use Give\Framework\Support\Contracts\Arrayable; |
| 6 | |
| 7 | class ReceiptSettings implements Arrayable |
| 8 | { |
| 9 | |
| 10 | /** |
| 11 | * @var array |
| 12 | */ |
| 13 | protected $settings; |
| 14 | |
| 15 | /** |
| 16 | * @param array $settings |
| 17 | */ |
| 18 | public function __construct(array $settings = []) { |
| 19 | $this->settings = $settings; |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * @since 3.0.0 |
| 24 | * |
| 25 | * @param string $key |
| 26 | * @param $value |
| 27 | * @return $this |
| 28 | */ |
| 29 | public function addSetting(string $key, $value): ReceiptSettings |
| 30 | { |
| 31 | $this->settings[$key] = $value; |
| 32 | |
| 33 | return $this; |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * @since 3.0.0 |
| 38 | */ |
| 39 | public function getSettings(): array |
| 40 | { |
| 41 | return $this->settings; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * @since 3.0.0 |
| 46 | */ |
| 47 | public function toArray(): array |
| 48 | { |
| 49 | return $this->settings; |
| 50 | } |
| 51 | } |