Validate a value with the enabled oEmbed providers (if required).

@since 2.7.0

@param string $value   Field value.
@param array  $options Field options.

@return bool
493498
public function validate_provider( $value, $options ) {

		// Check if we need to validate.
		if ( 0 === (int) pods_v( static::$type . '_restrict_providers', $options ) ) {
			return true;
		}

		$providers = $this->get_providers();

		// Filter existing providers.
		foreach ( $providers as $key => $provider ) {
			$fieldname = static::$type . '_enabled_providers_' . tag_escape( $provider['host'] );

			/**
			 * @todo Future compat to enable serialised strings as field options
			 */

			/**
			 * Current solution: all separate field options.
			 */
			if ( empty( $options[ $fieldname ] ) ) {
				unset( $providers[ $key ] );
			}
		}

		// Value validation.
		$provider_match = $this->get_provider( $value );

		foreach ( $providers as $match => $provider ) {
			if ( $provider_match === $match ) {
				return true;
			}
		}

		return false;
	}
1357475
public static function inline($value, $options = array())
    {
        $filter = new static();
        $filter->setOptions($options);
        return $filter->filter($value);
    }
26680
public function applyValidator($value, array $configuration)
    {
        // Validate configuration
        $resolver = new OptionsResolver();
        $this->configureOptions($resolver);
        $configuration = $resolver->resolve($configuration);

        $this->validate($value, $configuration);
    }
801681
public static function encode($value, $options = JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK)
    {
        if ($value instanceof \Traversable)
        {
            $value = \iterator_to_array($value);
        }

        return \json_encode($value, $options);
    }
783659
public function base64($value, array $options, $mode) {
        if ($mode === self::TO && $options['encode']) {
            return base64_encode($value);
        }

        if ($mode === self::FROM && $options['decode']) {
            return base64_decode($value);
        }

        return $value;
    }
1330291
protected function validateAccepted( $value )
	{
		$acceptable = ['yes', 'on', '1', 1, true, 'true'];

		return $this->validateRequired( $value ) && in_array( $value, $acceptable, true );
	}
1226964
public function tag($tag, $value, array $options = array()) {
        if ($options) {
            $this->_tags[$tag][] = array('value' => $value) + $options;
        } else {
            $this->_tags[$tag] = $value;
        }

        return $this;
    }
617628
protected function validate($value)
    {
        foreach ($this->validators as $validator) {
            if (!$validator->validate($value)) {
                throw new InvalidValueException(
                    "Field {$this->name}, was set with invalid value: " . var_export($value, true)
                );
            }
        }
    }
103635
public static function enum($value, $options){

		$value = static::_nullValue($value);

		if(!in_array($value, $options)){

			return null;
		}

		return $value;
	}
208062
public static function reset($value, array $options = [])
    {
        self::exclure($options, ['type', 'value']);

        return self::input('reset', 'null', $value, $options);
    }
158181
public function isValid($value = null, array $options = []): bool
    {
        if (\count($options) > 0) {
            $this->setOptions($options);
        }
        $this->setValue(\str_replace(' ', '', (string)$value));
        $this->errors = [];

        if ($this->options['type'] == 'any') {
            $types = \array_keys($this->validationData);
        } elseif (\array_key_exists($this->options['type'], $this->validationData)) {
            $types = [$this->options['type']];
        } else {
            throw new DomainException('Unsopported credit card type: '.$this->options['type']);
        }

        $validType = $this->validateType($types);
        $validNumber = $this->validateNumber();

        return $validType && $validNumber;
    }
710906
protected function isValid($value)
    {
        $result = preg_match($this->options['regularExpression'], $value);
        if ($result === 0) {
            $this->addError('The given subject did not match the pattern. Got: %1$s', 1221565130, [$value]);
        }
        if ($result === false) {
            throw new InvalidValidationOptionsException('regularExpression "' . $this->options['regularExpression'] . '" in RegularExpressionValidator contained an error.', 1298273089);
        }
    }
535979
public function isValid($value = null, array $options = []): bool
    {
        $this->setOptions($options);
        $this->setValue($value);
        $this->errors = [];

        $isValid = $this->validatePesel();

        return $isValid;
    }
670522
public function setOption(string $option, $value) {
        $this->validateOption($option, $value);
        $this->options[$option] = $value;
    }
482154
function optionExists($value) {
        foreach ($this->_options as $option) {
            if (isset($option['attr']['value']) && ($option['attr']['value'] == $value)) {
                return true;
            }
        }
        return false;
    }
478895
public function check($value, $hashedValue, array $options = [])
    {
        return $this->driver()->check($value, $hashedValue, $options);
    }
118691
public function serialize($value, array $options=[])
    {
        if (is_resource($value)) {
            throw new UnsupportedParameterException('You cant serialize a resource');
        }

        if ($value === $this->serializeFalseAs) {
            throw new UnsupportedParameterException('You cant serialize '.$this->serializeFalseAs.' cause its internally used to encode false');
        }

        if ($value === false) {
            $value = $this->serializeFalseAs;
        }

        return serialize($value);
    }