Define the mode of the filter. Possible values can be fount at self::$modes.

@param string $mode

@throws InvalidArgumentException
193444
protected function setMode($mode)
    {
        $mode = strtolower($mode);
        if (!in_array($mode, self::$modes)) {
            throw new InvalidArgumentException(sprintf('Invalid binary mode: %s', $mode));
        }
        $this->options['mode'] = $mode;
    }
792274
public function overrideMode($mode)
    {
        self::validateMode($mode);
        $this->mode = $mode;
        $this->overriddenMode = true;
    }
882823
private function setMode(int $mode)
    {
        $this->mode = $mode;
        $this->modeStartLine = $this->line;
        $this->modeStartPosition = $this->getCurrentLinePosition();
    }
617166
public function mode($mode = null)
    {
        if ($mode !== null) {
            $this->mode = (string) $mode;
        }

        return $this->mode;
    }
206880
public function setConditionMode(string $conditionMode)
    {
        if (!in_array($conditionMode, [self::CONDITION_MODE_AND, self::CONDITION_MODE_OR], true)) {
            throw Exception\InvalidArgumentException::format(
                'Invalid condition mode supplied to %s: expecting one of (%s), \'%s\' given',
                __METHOD__, Debug::formatValues([self::CONDITION_MODE_AND, self::CONDITION_MODE_OR]), $conditionMode
            );
        }

        $this->conditionMode = $conditionMode;

        return $this;
    }
1249195
public static function setNewFileMode(string $mode = '740'): void
    {
        static::init();
        static::$newFileMode = \preg_match('/^[0-7]{3}$/', $mode) ? \intval($mode, 8) : 0740;
    }
1187990
public function set_mode($mode){
    if ( router::is_mode($mode) ){
      $this->mode = $mode;
    }
    return $this->mode;
  }
1225584
public static function unload($mode)
    {

    	if (!is_string($mode)){
			throw new InvalidArgumentException('Try to unload an irregular mode in the context. The mode must be a string, ' . gettype($mode) . ' given.');
		}
    	else if (empty($mode)){
    		throw new InvalidArgumentException('Cannot unload an empty mode in the context.');
    	}
    	
    	if(in_array($mode, self::$current)){
    		$index = array_search ($mode, self::$current);
    		if ($index !== false){
    			unset (self::$current[$index]);
    		}
    	}
    }
543067
public function setOutputBuffering($mode)
    {
        if (!in_array($mode, [false, 'prepend', 'append'], true)) {
            throw new InvalidArgumentException('Unknown output buffering mode');
        }
        $this->outputBuffering = $mode;
    }
790680
public function setCustomHydrationModes(iterable $modes) : void
    {
        $this->customHydrationModes = [];

        foreach ($modes as $modeName => $hydrator) {
            $this->addCustomHydrationMode($modeName, $hydrator);
        }
    }
1231107
public function transformMode($mode)
    {
        if (\array_key_exists($mode, $this->modes))
        {
            return $this->modes[$mode];
        }

        throw new \UnexpectedValueException("Mode {$mode} does not exist");
    }
18614
public function removeMode ($mode)
    {
        if ($mode instanceof AdminPageMode)
            $mode = $mode->getSlug();
        unset($this->modes[$mode]);
    }
472719
public function setMode($mode = 'and')
    {
        $mode = in_array($mode, ['and', 'or']) ? $mode : 'and';

        $this->mode = $mode;

        return $this;
    }
354369
protected function loadTemplate(string $mode)
    {
        if ($mode == 'create') { // create mode
            $tplPath = sprintf(MODULE_VIEWS, $this->module . '/' . $this->division);
            $tplName = $tplPath . 'edit.php';
            $this->template->load($tplName);
        }
    }
1215234
private function parse_mode( &$mode, $buffer )
	{
		if ( substr( trim( $buffer ), 0, 6 ) === '# --->' )
		{
			$mode = trim( substr( $buffer, 6 ) );
		}
	}
189484
public function inMode( $mode )
	{
		if ( !is_array($mode) )
		{
			$mode = func_get_args();
		}

		return in_array( $this->reset_mode, $mode );
	}
399601
public function has($key, $mode = self::HAS_EXISTS)
    {
        $key = $this->normalizeKey($key);

        switch ($mode) {
            case self::HAS_EXISTS:
                return array_key_exists($key, $this->data);

            case self::HAS_ISSET:
                return isset($this->data[$key]);

            case self::HAS_NONEMPTY:
                return !empty($this->data[$key]);

            case self::HAS_LENGTH:
                return isset($this->data[$key]) && strlen($this->data[$key]);

            default:
                throw new InvalidArgumentException("Mode {$mode} not supported");
        }
    }