Return a disabled version of this field.

Tries to find a class of the class name of this field suffixed with "_Disabled", failing
that, finds a method {@link setDisabled()}.

@return FormField
486935
public function performDisabledTransformation()
    {
        $disabledClassName = static::class . '_Disabled';

        if (ClassInfo::exists($disabledClassName)) {
            $clone = $this->castedCopy($disabledClassName);
        } else {
            $clone = clone $this;
        }

        $clone->setDisabled(true);

        return $clone;
    }
143711
public function actionDisable()
    {
        $maintenance = Yii::$app->maintenanceMode;

        if ($maintenance->getIsEnabled(true) && $maintenance->disable()) {
            $this->stdout("Maintenance mode disabled successfully.\n", Console::FG_GREEN);
            return Controller::EXIT_CODE_NORMAL;
        } else {
            $this->stdout("Maintenance mode already disabled.\n", Console::FG_RED);
            return Controller::EXIT_CODE_ERROR;
        }
    }
1185631
public function value() {
		if($this->getOption('disabled'))
			return isset($this->options['default']) ? $this->options['default']:null;
		return $this->value;
	}
764404
public function getRootForm()
    {
        $rootRenderable = $this->parentRenderable;
        while ($rootRenderable !== null && !($rootRenderable instanceof FormDefinition)) {
            $rootRenderable = $rootRenderable->getParentRenderable();
        }
        if ($rootRenderable === null) {
            throw new FormDefinitionConsistencyException(sprintf('The form element "%s" is not attached to a parent form.', $this->identifier), 1326803398);
        }

        return $rootRenderable;
    }
197362
public function getApplyFormSettings()
    {
        if (!$this->applyFormSettings) {
            $settings = new DisableElementsCapableFormSettings();
            $settings->setForm('Applications/Apply');
            $this->applyFormSettings = $settings;
        }
        return $this->applyFormSettings;
    }
1036330
public function performReadonlyTransformation()
    {
        $field = new CheckboxField_Readonly($this->name, $this->title, $this->value);
        $field->setForm($this->form);
        return $field;
    }
553520
public function getDescriptionHelper()
    {
        if (!$this->descriptionHelper) {
            $this->setDescriptionHelper($this->view->plugin('formdescription'));
        }
        return $this->descriptionHelper;
    }
118255
public function withDisabledLabels(callable $disabledLabelCallback)
    {
        $this->updateOptions(function (ObjectIdentityOptions $options) use ($disabledLabelCallback) {
            return $options->withDisabledLabelCallback($disabledLabelCallback);
        });

        return $this;
    }
448135
private function getUnsettablePropertiesDeclaration()
    {

        // if unsettable properties are the default we don't need to do anything
        if( $this->unsetableProperties === array('id') ) {
            return array();
        }

        $unsetableProperties = array_map(
            function($property){
                return "'".addslashes($property)."'";
            }
            , $this->unsetableProperties
        );

        $this->class->classComponents[] = new VariableDeclaration(
            'unsetableProperties',
            new Sformatf( <<<'PHP'
                /**
                 * Unsetable properties
                 * @var array
                 */
                protected static $unsetableProperties = [%s];
PHP
                , implode( ', ', $unsetableProperties )
            )
        );

        return $this;

    }
1043488
public function disable($name = null)
	{
		// Check if it exists. if not, bail out
		if ( ! $this->field($name))
		{
			throw new \RuntimeException('Field "'.$name.'" does not exist in this Fieldset.');
		}

		isset($this->disabled[$name]) or $this->disabled[$name] = $name;

		return $this;
	}
885579
public function getCondForm() {
        $clz = static::class;
        if (isset(self::$forms[ $clz ])) {
            $form = self::$forms[ $clz ];

            return $form;
        }

        return null;
    }
131843
private function getUserFormHelper()
    {
        if (null === $this->userFormHelper) {
           $this->userFormHelper = $this->getServiceLocator()->get('csnuser_user_form');
        }
      
        return $this->userFormHelper;
    }
920147
public function isEnabled()
    {
        return ($c = $this->enabledAttribute) !== null
            ? (boolean) $this->owner->$c
            : (($c = $this->disabledAttribute) !== null ? (boolean) !$this->owner->$c : null);
    }
769359
public function enabledFields()
    {
        return array_merge(
            (is_string($this->guidAttribute) && !empty($this->guidAttribute)) ? [$this->guidAttribute] : [],
            (is_string($this->idAttribute) && !empty($this->idAttribute)) ? [$this->idAttribute] : [],
            $this->enabledTimestampFields(),
            $this->enabledIPFields()
        );
    }
882545
public function isDisabled(): bool
    {
        if (null !== $this->reenableAfter && null !== $this->disabledAt) {
            // Reenable after a certain time
            $now = new \DateTime();

            if (($now->getTimestamp() - $this->disabledAt->getTimestamp()) >= $this->reenableAfter) {
                $this->enable();

                return false;
            }

            return true;
        }

        return null !== $this->disabledAt;
    }
1096901
public function getSchemaDataDefaults()
    {
        $schema = array_merge(
            parent::getSchemaDataDefaults(),
            [
                'name' => $this->getName() . '[]',
                'lazyLoad' => $this->getShouldLazyLoad(),
                'creatable' => $this->getCanCreate(),
                'multi' => $this->getIsMultiple(),
                'value' => $this->formatOptions($this->Value()),
                'disabled' => $this->isDisabled() || $this->isReadonly(),
            ]
        );

        if (!$this->getShouldLazyLoad()) {
            $schema['options'] = $this->getOptions()->toNestedArray();
        } else {
            $schema['optionUrl'] = $this->getSuggestURL();
        }

        return $schema;
    }
1204986
protected function getFormConfiguration()
    {
        $formConfigurationArray = $this->getFormObject()->getConfiguration()->toArray();
        $this->removeFieldsValidationConfiguration($formConfigurationArray)
            ->addClassNameProperty($formConfigurationArray);

        return ArrayService::get()->arrayToJavaScriptJson($formConfigurationArray);
    }