protected function initData()
{
if ($this->data !== null) {
return;
}
if ($this->value !== null) {
$this->data = $this->value;
return;
}
if ($this->model instanceof Model) {
$data = $this->model->hasProperty($this->attribute) ? ArrayHelper::getValue($this->model, $this->attribute, []) : [];
foreach ((array) $data as $index => $value) {
$this->data[$index] = $value;
}
}
}