Determines whether the submitted form was empty.

@param array $elementvalue value of element submitted from the form
@return boolean true if the form is empty
775266
public function is_empty_form($elementvalue) {
        $criteria = $this->get_controller()->get_definition()->guide_criteria;
        foreach ($criteria as $id => $criterion) {
            $score = $elementvalue['criteria'][$id]['score'];
            $remark = $elementvalue['criteria'][$id]['remark'];

            if ((isset($score) && $score !== '')
                    || ((isset($remark) && $remark !== ''))) {
                return false;
            }
        }
        return true;
    }
1188233
function _ruleIsUploadedFile($elementValue)
    {
        if ((isset($elementValue['error']) && $elementValue['error'] == 0) ||
            (!empty($elementValue['tmp_name']) && $elementValue['tmp_name'] != 'none')) {
            return is_uploaded_file($elementValue['tmp_name']);
        } else {
            return false;
        }
    }
322255
def element_is_empty(elem_to_parse, element_path=None):
    

    element = get_element(elem_to_parse, element_path)

    if element is None:
        return True

    is_empty = (
        (element.text is None or not element.text.strip()) and
        (element.tail is None or not element.tail.strip()) and
        (element.attrib is None or not len(element.attrib)) and
        (not len(element.getchildren()))
    )

    return is_empty
224515
protected function vaidateValue($value, $element)
    {
        if ($this->isEmpty($value)) {
            $element->setValue($this->getValue());
        }

        return true;
    }
644047
protected function isElementValid($element) : bool
    {
        return is_a($element, $this->getType()) || is_subclass_of($element, $this->getType());
    }
140483
public function isValueEmpty($value, ElementInterface $element = null): bool
    {
        return parent::isValueEmpty($value, $element);
    }
210347
public function new_submission_empty($data) {
        foreach ($this->submissionplugins as $plugin) {
            if ($plugin->is_enabled() && $plugin->is_visible() && $plugin->allow_submissions() &&
                    !$plugin->submission_is_empty($data)) {
                return false;
            }
        }
        return true;
    }
1077407
function _ruleCheckMaxFileSize($elementValue, $maxSize)
    {
        if (!empty($elementValue['error']) && 
            (UPLOAD_ERR_FORM_SIZE == $elementValue['error'] || UPLOAD_ERR_INI_SIZE == $elementValue['error'])) {
            return false;
        }
        if (!HTML_QuickForm_file::_ruleIsUploadedFile($elementValue)) {
            return true;
        }
        return ($maxSize >= @filesize($elementValue['tmp_name']));
    }
715100
protected function SaveElement()
    {
        $this->submit->SetName($this->Value('Name'));
        $this->submit->SetValue($this->Value('Value'));
        return $this->submit;
    }
891487
public function isNullableRequired($defaultValue = self::NULLABLE_DEFAULT)
    {
        $isNullable = !$this->isNotNull();

        return $isNullable === $defaultValue ? ($this->isAlwaysNullable() ? true : false) : true;
    }
946117
public function onSubmit(FormRuntime $formRuntime, &$elementValue)
    {
        $imageTypeValidator = new ImageTypeValidator(array('allowedTypes' => $this->properties['allowedTypes']));
        $this->addValidator($imageTypeValidator);
    }
7312
public function get_element($elementname) {
        if ($this->_form->elementExists($elementname)) {
            return $this->_form->getElement($elementname);
        } else {
            return false;
        }
    }
36348
private function isEmpty($value)
    {
        // Assume that the value is empty
        $empty = true;

        // If the value is an array
        if (is_array($value)) {
            foreach ($value as $element) {
                // The value is empty if all elements of the array are empty
                $empty = $empty && $this->isEmpty($element);
            }
        } else {
            // We can't use the empty function here because it treats "0" as empty
            $empty = strlen($value) == 0;
        }

        return $empty;
    }
960544
public static function validateElement(array $element, FormStateInterface $form_state) {
    if ($element['#required'] && $element['#value'] == '_none') {
      $form_state->setError($element, t('@name field is required.', ['@name' => $element['#title']]));
    }

    // Save the value in the element key_column.
    // Note: there is only one item because the field is not multiple value.
    $items = [$element['#key_column'] => $element['#value']];

    $form_state->setValueForElement($element, $items);
  }
1051191
public function isValid()
    {
        // get the submitted value
        $value = $this->field->getForm()->getFieldValue($this->field->getName());

        // required but not given
        if ($this->required && $value == null) {
            return false;
        } // if the field is not required and the value is empty, then it's also valid
        elseif (!$this->required && $value == "") {
            return true;
        }

        // check if multiple values are returned and if this is allowed.
        if (is_array($value) && !$this->field->isMultiple()) {
            return false;
        }

        // check if the submitted value(s) are in the options value's
        $options = $this->field->getOptions();

        if (!is_array($value)) {
            $value = (array)$value;
        }

        // check if the selected options exist
        if (!$this->checkIfOptionsExists($value, $options)) {
            return false;
        }

        return true;
    }
1078646
public function isEmpty()
    {
        $isEmpty = empty($this->storage);

        if ($isEmpty === false) {
            if ($this->length() == 1) {
                if (is_null($this->values()[0])) {
                    $isEmpty = true;
                }
            }
        }

        return $isEmpty;
    }
52668
public function validate() {
        $validated = TRUE;

        foreach($this->getFormElements() as $name => $child) {
            $validated &= $child->validate();
        }

        $validated &= $this->fireEvent("Form\onValidate", [ $this->value, $this ], TRUE, FALSE);

        return (bool)$validated;
    }