/** * Disables or enables control or items. * @param bool|array * @return self */ public function setDisabled($value = TRUE) { if (!is_array($value)) { return parent::setDisabled($value); } parent::setDisabled(FALSE); $this->disabled = array_fill_keys($value, TRUE); $this->value = array_diff($this->value, $value); return $this; }
/** * Disables or enables control or items. * @param bool|array * @return self */ public function setDisabled($value = TRUE) { if (!is_array($value)) { return parent::setDisabled($value); } parent::setDisabled(FALSE); $this->disabled = array_fill_keys($value, TRUE); if (isset($this->disabled[$this->value])) { $this->value = NULL; } return $this; }