| Total Complexity | 7 |
| Total Lines | 70 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 16 | class Chart extends Widget |
||
| 17 | { |
||
| 18 | /** @var bool */ |
||
| 19 | public $status = true; |
||
| 20 | /** @var array */ |
||
| 21 | public $containerOptions = []; |
||
| 22 | /** @var array */ |
||
| 23 | public $clientData = []; |
||
| 24 | /** @var array */ |
||
| 25 | public $clientOptions = []; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @inheritDoc |
||
| 29 | */ |
||
| 30 | public function init() |
||
| 31 | { |
||
| 32 | parent::init(); |
||
| 33 | if ($this->status === true) { |
||
| 34 | $this->registerAsset(); |
||
| 35 | } |
||
| 36 | $this->id = $this->id ?: $this->getId(); |
||
| 37 | ArrayHelper::setValue($this->containerOptions, 'id', $this->id); |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Run |
||
| 42 | * |
||
| 43 | * @return string |
||
| 44 | */ |
||
| 45 | public function run() |
||
| 46 | { |
||
| 47 | return Html::tag('div', '', $this->containerOptions); |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Client Data |
||
| 52 | * |
||
| 53 | * @return array |
||
| 54 | */ |
||
| 55 | public function getClientData() |
||
| 56 | { |
||
| 57 | $clientData = []; |
||
| 58 | return ArrayHelper::merge($clientData, $this->clientData); |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Client Options |
||
| 63 | * |
||
| 64 | * @return array |
||
| 65 | */ |
||
| 66 | public function getClientOptions() |
||
| 67 | { |
||
| 68 | $clientOptions = []; |
||
| 69 | return ArrayHelper::merge($clientOptions, $this->clientOptions); |
||
| 70 | } |
||
| 71 | |||
| 72 | /** |
||
| 73 | * Register Asset |
||
| 74 | */ |
||
| 75 | public function registerAsset() |
||
| 86 | } |
||
| 87 | } |
||
| 88 |