| 1 | <?php namespace Arcanedev\LaravelExcel\Traits; |
||
| 11 | trait WithOptions |
||
| 12 | { |
||
| 13 | /* ----------------------------------------------------------------- |
||
| 14 | | Properties |
||
| 15 | | ----------------------------------------------------------------- |
||
| 16 | */ |
||
| 17 | |||
| 18 | protected $options = []; |
||
| 19 | |||
| 20 | /* ----------------------------------------------------------------- |
||
| 21 | | Main Methods |
||
| 22 | | ----------------------------------------------------------------- |
||
| 23 | */ |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Get all the options. |
||
| 27 | * |
||
| 28 | * @return array |
||
| 29 | */ |
||
| 30 | 93 | public function getOptions() |
|
| 34 | |||
| 35 | /** |
||
| 36 | * Get an option. |
||
| 37 | * |
||
| 38 | * @param string $key |
||
| 39 | * @param mixed $default |
||
| 40 | * |
||
| 41 | * @return mixed |
||
| 42 | */ |
||
| 43 | 18 | public function getOption($key, $default = null) |
|
| 47 | |||
| 48 | /** |
||
| 49 | * Set the options. |
||
| 50 | * |
||
| 51 | * @param array $options |
||
| 52 | * |
||
| 53 | * @return self |
||
| 54 | */ |
||
| 55 | 93 | public function setOptions(array $options) |
|
| 61 | |||
| 62 | /** |
||
| 63 | * Set an option. |
||
| 64 | * |
||
| 65 | * @param string $key |
||
| 66 | * @param mixed $value |
||
| 67 | * |
||
| 68 | * @return self |
||
| 69 | */ |
||
| 70 | 36 | public function setOption($key, $value) |
|
| 76 | |||
| 77 | /** |
||
| 78 | * Reset the options. |
||
| 79 | * |
||
| 80 | * @param array $options |
||
| 81 | * |
||
| 82 | * @return self |
||
| 83 | */ |
||
| 84 | 93 | public function resetOptions(array $options = []) |
|
| 90 | } |
||
| 91 |