Performs full address data validation
@param array $submitted
@param array $options
@return array|boolean
557345
public function address(array &$submitted, array $options = array())
    {
        $this->options = $options;
        $this->submitted = &$submitted;

        $this->validateAddress();
        $this->validateCountryAddress();

        $this->validateStateAddress();
        $this->validateCityAddress();
        $this->validateTypeAddress();
        $this->validateFieldsAddress();
        $this->validateUserIdAddress();
        $this->validateData();

        $this->unsetSubmitted('update');

        return $this->getResult();
    }
759776
public function fieldValue(array &$submitted, array $options = array())
    {
        $this->options = $options;
        $this->submitted = &$submitted;

        $this->validateFieldValue();
        $this->validateTitle();
        $this->validateWeight();
        $this->validateTranslation();
        $this->validateFieldFieldValue();
        $this->validateColorFieldValue();
        $this->validateUploadImages('field_value');

        $this->unsetSubmitted('update');
        $this->unsetSubmitted('field');

        return $this->getResult();
    }
892475
public function verifyAddress($address, $signature) {
        if ($this->verifyMessage($address, $address, $signature)) {
            return ['result' => true, 'msg' => 'Successfully verified'];
        } else {
            return ['result' => false];
        }
    }
125544
public function validates($entity, $options = [])
    {
        $fieldname = $this->name();

        if (!isset($entity->{$fieldname})) {
            return true;
        }
        return $entity->{$fieldname}->validates($options);
    }
461532
final public static function hasNumber ($value, array $options=[]) : bool
	{
		if (!self::hasValue($value))  new ErrorCode(1001);

		// Submitted values are strings, so use is_numeric instead of is_int
		if (!is_numeric($value)) return FALSE;

		if (!empty($options)) return static::hasLength($value, $options);

		return TRUE;
	}
1150706
public function currency(array &$submitted, array $options = array())
    {
        $this->options = $options;
        $this->submitted = &$submitted;

        $this->validateCurrency();
        $this->validateBool('default');
        $this->validateBool('status');
        $this->validateCodeCurrency();
        $this->validateName();
        $this->validateNumericCodeCurrency();
        $this->validateSymbolCurrency();
        $this->validateMajorUnitCurrency();
        $this->validateMinorUnitCurrency();
        $this->validateConvertionRateCurrency();
        $this->validateDecimalsCurrency();
        $this->validateRoundingStepCurrency();

        $this->unsetSubmitted('update');

        return $this->getResult();
    }
1372380
public function execute($options = array())
    {
        $message = $options['message'];

        // First, check subject, no error, return.
        if (!preg_match("/error/i", $message->getSubject())) return true;

        // Find who to send this to.
        $first = $message->getFirstPost();

        $receivers = isset($options['attributes']) 
            ? $options['attributes'] : array();

        // I'm not ready for validating a mail address. this is just a simple.
        if ($first->getFrom())
            $receivers[] = $first->getFrom();

        $options['provide_link'] = true;
        foreach ($receivers as $receiver) {
            $this->sendMail($message, $receiver, $options);
        }
        // Message is handled, put in the archive
        $message->setState('ARCHIVED');
    }
25415
protected function buildAddressFields(array &$form, array &$complete_form, array $address = []) {
    $form['address_wrapper'] = [
      '#type' => 'container',
      '#attributes' => [
        'id' => ['address_wrapper'],
        'class' => ['customer-address-form'],
      ],
    ];

    $checkout_config = \Drupal::config('acm_checkout.settings');
    $validate_saved_address = $checkout_config->get('validate_saved_address');
    $address_review_text = $checkout_config->get('saved_address_review_text');
    $address_failed_text = $checkout_config->get('saved_address_failed_text');

    $include_address_id = empty($address) ? FALSE : TRUE;
    $form['address_wrapper']['address'] = [
      '#type' => 'acm_address',
      '#default_value' => $address,
      '#display_title' => TRUE,
      '#display_firstname' => TRUE,
      '#display_lastname' => TRUE,
      '#display_billing' => TRUE,
      '#display_shipping' => TRUE,
      '#include_address_id' => $include_address_id,
      '#validate_address' => $validate_saved_address,
      '#address_review_text' => $address_review_text,
      '#address_failed_text' => $address_failed_text,
    ];

    $form['address_wrapper']['actions'] = [
      '#type' => 'actions',
    ];

    $form['address_wrapper']['actions']['cancel'] = [
      '#type' => 'link',
      '#title' => $this->t('Cancel'),
      '#url' => Url::fromRoute('acm_customer.view_page', [
        'page' => $this->getPageId(),
      ]),
    ];

    $form['address_wrapper']['actions']['save'] = [
      '#type' => 'submit',
      '#value' => $this->t('Save'),
    ];

    // Remove parent actions.
    unset($complete_form['actions']);
  }
276447
private function validate(array $options)
    {
        if (array_key_exists('mandatorId', $options)) {
            $options['mandatorId'] = (int) $options['mandatorId'];
        }

        list($customerId, $licenseKey) =
            $this->siteAccessHelper->getRecommendationServiceCredentials($options['mandatorId'], $options['siteaccess']);

        $options = array_filter($options, function ($val) {
            return $val !== null;
        });

        $resolver = new OptionsResolver();
        $resolver->setRequired(['contentTypeIdList', 'host', 'webHook', 'transaction']);
        $resolver->setDefined(array_keys($options));
        $resolver->setDefaults([
            'transaction' => (new \DateTime())->format('YmdHis') . rand(111, 999),
            'customerId' => $customerId,
            'licenseKey' => $licenseKey,
            'mandatorId' => null,
            'siteaccess' => null,
            'lang' => null,
        ]);

        return $resolver->resolve($options);
    }
325078
public function verifyEmailToken($options = []) {
		$options = Hash::merge(
			$this->getConfig('verifyEmailToken'),
			$options,
			['type' => 'Email']
		);

		return $this->verifyToken($options);
	}
742009
public function form(array $options = [])
    {
        $method = empty($options['method']) ? $options['method'] : '';
        if (in_array(strtolower($method), ['get', 'post'])) {
            $real_method = $method;
        } else {
            $real_method = 'POST';
        }
        $options['method'] = $real_method;
        $options['action'] = $this->location;

        return '<form '.$this->attributes($options).'>'.// Pass the method through so the form knows how to handle it's self (with laravel)
        $this->method($method).// Check and fill the csrf token if it's configured for it.
        $this->csrf().$this->buildForm().$this->submit([]).'</form>';
    }
294879
public function collection(array &$submitted, array $options = array())
    {
        $this->options = $options;
        $this->submitted = &$submitted;

        $this->validateCollection();
        $this->validateBool('status');
        $this->validateTitle();
        $this->validateDescription();
        $this->validateTranslation();
        $this->validateStoreId();
        $this->validateTypeCollection();

        $this->unsetSubmitted('update');

        return $this->getResult();
    }
336159
public function categoryGroup(array &$submitted, array $options = array())
    {
        $this->options = $options;
        $this->submitted = &$submitted;

        $this->validateCategoryGroup();
        $this->validateTitle();
        $this->validateTranslation();
        $this->validateStoreId();
        $this->validateTypeCategoryGroup();

        $this->unsetSubmitted('update');

        return $this->getResult();
    }
112489
public static function submit($value, array $options = [])
    {
        self::exclure($options, ['type', 'value']);

        return self::input('submit', 'null', $value, $options);
    }
217126
public function validateCreate(&$submitted, $options = array())
    {
        $this->options = $options;
        $this->submitted = &$submitted;

        $this->validateNameCreate();
        $this->validateDestinationCreate();

        return $this->getResult();
    }
600676
public function file(array &$submitted, array $options = array())
    {
        $this->options = $options;
        $this->submitted = &$submitted;

        $this->validateFile();
        $this->validateTitleFile();
        $this->validateDescription();
        $this->validateWeight();
        $this->validateTranslation();
        $this->validateUploadFile();
        $this->validatePathFile();
        $this->validateEntityFile();
        $this->validateEntityIdFile();
        $this->validateFileTypeFile();
        $this->validateMimeTypeFile();

        $this->unsetSubmitted('update');

        return $this->getResult();
    }
310492
function validate($value, $key, $fields, $options, $exists, \CharlotteDunois\Validation\Validator $validator) {
        if(!$exists) {
            return false;
        }
        
        $n = \explode(',', $options);
        if(!\in_array($value, $n)) {
            return array('formvalidator_make_in', array('{0}' => $options));
        }
        
        return true;
    }