static public function isValidSelectionMode($mode, $throw = false)
    {
        $valid = in_array($mode, [
            static::SELECTION_SINGLE,
            static::SELECTION_MULTIPLE,
        ], true);

        if (!$valid && $throw) {
            throw new Exception\InvalidArgumentException("Invalid selection mode '{$mode}'.");
        }

        return $valid;
    }
static public function isValidSelectionMode($mode, $throw = false)
    {
        $valid = in_array($mode, [
            static::SELECTION_SINGLE,
            static::SELECTION_MULTIPLE,
        ], true);

        if (!$valid && $throw) {
            throw new Exception\InvalidArgumentException("Invalid selection mode '{$mode}'.");
        }

        return $valid;
    }
static public function isValidSelectionMode ( $ mode , $ throw = false ) { $ valid = in_array ( $ mode , [ static :: SELECTION_SINGLE , static :: SELECTION_MULTIPLE , ] , true ) ; if ( ! $ valid && $ throw ) { throw new Exception \ InvalidArgumentException ( "Invalid selection mode '{$mode}'." ) ; } return $ valid ; }
Returns whether the given selection mode is valid or not.

@param string $mode  The selection mode.
@param bool   $throw Whether to throw an exception if the given mode is not valid.

@return bool
Returns whether the given selection mode is valid or not .