Checks if all bank information is set.

@param array $requiredFields  fields must be set.
@param array $bankInformation actual information.

@return bool
517079
protected function _isAllBankInformationSet($requiredFields, $bankInformation)
    {
        $isSet = true;
        foreach ($requiredFields as $fieldName) {
            if (!isset($bankInformation[$fieldName]) || !trim($bankInformation[$fieldName])) {
                $isSet = false;
                break;
            }
        }

        return $isSet;
    }
939206
public boolean noFieldsInvalid(Collection<I_CmsFormField> fields) {

        for (I_CmsFormField field : fields) {
            if (field.getValidationStatus().equals(I_CmsFormField.ValidationStatus.invalid)) {
                return false;
            }
        }
        return true;
    }
684055
public function isRequired()
    {
        if (!empty($this->validation)) {
            foreach ($this->validation as $validation) {
                if ($validation instanceof Validation\Required) {
                    return true;
                }
            }
        }

        return false;
    }
1001123
public void setIsRequired(boolean required) {
        if (! required) {
            validators.remove(REQUIRED_FIELD_VALIDATOR);
        } else if (! isRequired()) {
            validators.add(REQUIRED_FIELD_VALIDATOR);
        }
    }
1371538
public function required($required = null) {

		if(false === is_bool($required) && null !== $required) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type boolean, "%s" given', __METHOD__, gettype($required)), E_USER_ERROR);
		}

		if(null === $required) {
			$required = true;
		}

		foreach($this -> getFieldnames() as $field) {
			$this -> required[$field] = $required;
		}

		return $this;
	}
509500
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case POOL_INFO_STRING:
      return isSetPoolInfoString();
    case JOB_INPUT_SIZE:
      return isSetJobInputSize();
    }
    throw new IllegalStateException();
  }
932298
public function setRequired($required)
    {
        if (!empty($required)) {
            $this->validation[] = new Validation\Required;
        }

        $this->attributes["required"] = "";
    }
1242673
protected function setRequiredFields()
    {
        $requiredFields = [
            'transaction_id',
            'payment_type',
            'remote_ip',
            'amount',
            'currency',
            'return_success_url',
            'return_failure_url',
            'customer_email',
            'billing_country'
        ];

        $this->requiredFields = CommonUtils::createArrayObject($requiredFields);

        $requiredFieldValues = [
            'payment_type'    => PaymentMethods::getMethods(),
            'billing_country' => \Genesis\Utils\Country::getList(),
            'currency'        => \Genesis\Utils\Currency::getList()
        ];

        $this->requiredFieldValues = CommonUtils::createArrayObject($requiredFieldValues);

        $requiredFieldsConditional = [
            'payment_type' => [
                PaymentMethods::GIRO_PAY   => [
                    'bic',
                    'iban'
                ],
                PaymentMethods::PRZELEWY24 => [
                    'customer_email'
                ],
                PaymentMethods::QIWI       => [
                    'account_phone'
                ]
            ]
        ];

        $this->requiredFieldsConditional = CommonUtils::createArrayObject($requiredFieldsConditional);

        $this->setRequiredFieldValuesConditional();
    }
452718
protected function hasRequiredData($mappedrecord)
    {
        if (!is_array($mappedrecord) || empty($mappedrecord) || !array_filter($mappedrecord)) {
            return false;
        }
        foreach ($this->transforms as $field => $t) {
            if (
                is_array($t) &&
                isset($t['required']) &&
                $t['required'] === true &&
                (!isset($mappedrecord[$field]) ||
                empty($mappedrecord[$field]))
            ) {
                return false;
            }
        }
        
        return true;
    }
667083
public function fieldIsRequired($fieldName)
    {
        if ($rules = $this->getRulesForFieldName($fieldName)) {
            
            foreach ($rules as $rule) {
                
                if ($rule instanceof RequiredRule) {
                    return true;
                }
                
            }
            
        }
        
        return parent::fieldIsRequired($fieldName);
    }
744826
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case GUID:
      return isSetGuid();
    case SECRET:
      return isSetSecret();
    }
    throw new IllegalStateException();
  }
927183
public function validateAsRequiredFields(array $fields) {
		foreach ($fields as $v) {
			$options = $this->fields[$v];
			$options['options']['required'] = true;
			$this->validateRequiredOneField($this->values[$v], $v, $options);
		}
	}
976531
private function isRequired($field, $value) {
		
		if(true === isset($this -> required[$field])) {
			
			$empty = true;

			if(true === is_array($value)) {

				foreach($value as $val) {

					if(strlen(trim($val)) > 0) {
						$empty = false;
					}
				}
			}

			if(true === is_string($value) && strlen(trim($value)) > 0) {
				$empty = false;
			}

			if(false === $this -> required[$field] && $empty) {
			    return true;
			}
		}

		return false;
	}
989594
def validate(self):
        """"""
        # check if required_fields aren't present
        for field in set(self.required_fields) - set(self.request_data):
            if not isinstance(field, string_types):
                # field was a collection, iterate over it and check by OR
                return bool(set(field) & set(self.request_data))
            return False
        return True
411725
public function isAuthorized($requiredRole)
    {
        $userRole = $this->session->getData('role');
        $permissions = ['N' => 1, 'A' => 2, 'S' => 3];

        if (!($requiredRole === 'A' || $requiredRole === 'S')) {
            return false;
        }

        return ($permissions[$requiredRole] <= $permissions[$userRole]);
    }
346553
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case QUALIFIERS:
      return isSetQualifiers();
    }
    throw new IllegalStateException();
  }
945483
public static function hasRequiredFields($model, $fields)
    {
        foreach ($fields as $column) {
            if (!is_array($column)) {
                if ($column instanceof ActiveField && $model->isAttributeRequired($column->attribute)) {
                    return true;
                }
                continue;
            }

            foreach ($column as $row) {
                if (!is_array($row)) {
                    if ($row instanceof ActiveField && $model->isAttributeRequired($row->attribute)) {
                        return true;
                    }
                    continue;
                }

                if (static::hasRequiredFields($model, $row)) {
                    return true;
                }
            }

        }
        return false;
    }