DMS\Filter\Rules\Rule::__construct PHP Méthode

__construct() public méthode

Initializes the filter rule with its options
public __construct ( mixed $options = null )
$options mixed The options (as associative array) or the value for the default option (any other type)
    public function __construct($options = null)
    {
        $result = $this->parseOptions($options);
        if (count($result->invalidOptions) > 0) {
            throw new InvalidOptionsException(sprintf('The options "%s" do not exist in rule %s', implode('", "', $result->invalidOptions), get_class($this)), $result->invalidOptions);
        }
        if (count($result->missingOptions) > 0) {
            throw new MissingOptionsException(sprintf('The options "%s" must be set for rule %s', implode('", "', array_keys($result->missingOptions)), get_class($this)), array_keys($result->missingOptions));
        }
    }