Fully Qualified Name: | Laminas\Validator\File\ExcludeMimeType |
Extends: | MimeType |
Validator for the mime type of a file
Name | Description | Defined By |
---|---|---|
__construct() | Sets validator options | MimeType |
__get() | Magic function returns the value of the requested property, if and only if it is the value or a message variable. | AbstractValidator |
__invoke() | Invoke as command | AbstractValidator |
addMimeType() | Adds the mimetypes | MimeType |
disableMagicFile() | Disables usage of MagicFile | MimeType |
enableHeaderCheck() | Defines if the http header should be used Note that this is unsafe and therefor the default value is false | MimeType |
getDefaultTranslator() | Get default translation object for all validate objects | AbstractValidator |
getDefaultTranslatorTextDomain() | Get default translation text domain for all validate objects | AbstractValidator |
getHeaderCheck() | Returns the Header Check option | MimeType |
getMagicFile() | Returns the actual set magicfile | MimeType |
getMessageLength() | Returns the maximum allowed message length | AbstractValidator |
getMessageTemplates() | Returns the message templates from the validator | AbstractValidator |
getMessageVariables() | Returns an array of the names of variables that are used in constructing validation failure messages | AbstractValidator |
getMessages() | Returns array of validation failure messages | AbstractValidator |
getMimeType() | Returns the set mimetypes | MimeType |
getOption() | Returns an option | AbstractValidator |
getOptions() | Returns all available options | AbstractValidator |
getTranslator() | Return translation object | AbstractValidator |
getTranslatorTextDomain() | Return the translation text domain | AbstractValidator |
hasDefaultTranslator() | Is there a default translation object set? | AbstractValidator |
hasTranslator() | Does this validator have its own specific translator? | AbstractValidator |
isMagicFileDisabled() | Is usage of MagicFile disabled? | MimeType |
isTranslatorEnabled() | Is translation enabled? | AbstractValidator |
isValid() | Returns true if the mimetype of the file does not matche the given ones. Also parts of mimetypes can be checked. If you give for example "image" all image mime types will not be accepted like "image/gif", "image/jpeg" and so on. | ExcludeMimeType |
isValueObscured() | Retrieve flag indicating whether or not value should be obfuscated in messages | AbstractValidator |
setDefaultTranslator() | Set default translation object for all validate objects | AbstractValidator |
setDefaultTranslatorTextDomain() | Set default translation text domain for all validate objects | AbstractValidator |
setMagicFile() | Sets the magicfile to use if null, the MAGIC constant from php is used if the MAGIC file is erroneous, no file will be set if false, the default MAGIC file from PHP will be used | MimeType |
setMessage() | Sets the validation failure message template for a particular key | AbstractValidator |
setMessageLength() | Sets the maximum allowed message length | AbstractValidator |
setMessages() | Sets validation failure message templates given as an array, where the array keys are the message keys, and the array values are the message template strings. | AbstractValidator |
setMimeType() | Sets the mimetypes | MimeType |
setOptions() | Sets one or multiple options | AbstractValidator |
setTranslator() | Set translation object | AbstractValidator |
setTranslatorEnabled() | Indicate whether or not translation should be enabled | AbstractValidator |
setTranslatorTextDomain() | Set translation text domain | AbstractValidator |
setValueObscured() | Set flag indicating whether or not value should be obfuscated in messages | AbstractValidator |
Sets validator options
Mimetype to accept
Parameter Name | Type | Description |
---|---|---|
$options | string|array|\Traversable |
Returns:
Magic function returns the value of the requested property, if and only if it is the value or a message variable.
Parameter Name | Type | Description |
---|---|---|
$property | string |
Returns: mixed
Invoke as command
Parameter Name | Type | Description |
---|---|---|
$value | mixed |
Returns: bool
Adds the mimetypes
Parameter Name | Type | Description |
---|---|---|
$mimetype | string|array | The |
Returns: $this Provides a fluent interface
Disables usage of MagicFile
Parameter Name | Type | Description |
---|---|---|
$disable | False | |
$disable |
Returns: $this Provides fluid interface
Defines if the http header should be used Note that this is unsafe and therefor the default value is false
Parameter Name | Type | Description |
---|---|---|
$headerCheck | bool |
Returns: $this Provides fluid interface
Get default translation object for all validate objects
Returns: \Translator\TranslatorInterface|null
Get default translation text domain for all validate objects
Returns: string
Returns the Header Check option
Returns: bool
Returns the actual set magicfile
Returns: string
Returns the maximum allowed message length
Returns: int
Returns the message templates from the validator
Returns: array
Returns an array of the names of variables that are used in constructing validation failure messages
Returns: array
Returns array of validation failure messages
Returns: array
Returns the set mimetypes
Parameter Name | Type | Description |
---|---|---|
$asArray | bool | Returns |
Returns: string|array
Returns an option
Parameter Name | Type | Description |
---|---|---|
$option | string | Option |
Returns: mixed Returned option
Returns all available options
Returns: array Array with all available options
Return translation object
Returns: \Translator\TranslatorInterface|null
Return the translation text domain
Returns: string
Is there a default translation object set?
Returns: bool
Does this validator have its own specific translator?
Returns: bool
Is usage of MagicFile disabled?
Returns: bool
Is translation enabled?
Returns: bool
Returns true if the mimetype of the file does not matche the given ones. Also parts of mimetypes can be checked. If you give for example "image" all image mime types will not be accepted like "image/gif", "image/jpeg" and so on.
Parameter Name | Type | Description |
---|---|---|
$value | string|array | Real |
$file | array | File |
Returns: bool
Retrieve flag indicating whether or not value should be obfuscated in messages
Returns: bool
Set default translation object for all validate objects
Parameter Name | Type | Description |
---|---|---|
$translator | \Translator\TranslatorInterface|null | |
$textDomain | string | (optional) |
Returns: void
Set default translation text domain for all validate objects
Parameter Name | Type | Description |
---|---|---|
$textDomain | string |
Returns: void
Sets the magicfile to use if null, the MAGIC constant from php is used if the MAGIC file is erroneous, no file will be set if false, the default MAGIC file from PHP will be used
Parameter Name | Type | Description |
---|---|---|
$file | string |
Returns: $this Provides fluid interface
Sets the validation failure message template for a particular key
Parameter Name | Type | Description |
---|---|---|
$messageString | string | |
$messageKey | string | OPTIONAL |
Returns: $this Provides a fluent interface
Sets the maximum allowed message length
Parameter Name | Type | Description |
---|---|---|
$length | int |
Returns:
Sets validation failure message templates given as an array, where the array keys are the message keys, and the array values are the message template strings.
Parameter Name | Type | Description |
---|---|---|
$messages | array |
Returns: $this
Sets the mimetypes
Parameter Name | Type | Description |
---|---|---|
$mimetype | string|array | The |
Returns: $this Provides a fluent interface
Sets one or multiple options
Parameter Name | Type | Description |
---|---|---|
$options | array|\Traversable | Options |
Returns: $this Provides fluid interface
Set translation object
Parameter Name | Type | Description |
---|---|---|
$translator | \Translator\TranslatorInterface|null | |
$textDomain | string | (optional) |
Returns: $this
Indicate whether or not translation should be enabled
Parameter Name | Type | Description |
---|---|---|
$flag | bool |
Returns: $this
Set translation text domain
Parameter Name | Type | Description |
---|---|---|
$textDomain | string |
Returns: $this
Set flag indicating whether or not value should be obfuscated in messages
Parameter Name | Type | Description |
---|---|---|
$flag | bool |
Returns: $this