Menu

## ValidateOptions extends Ext

ValidateOptions.php : 21

Common validation options that can be specified for all validation methods.

### Table of Contents

__construct() : mixed
allowEmpty() : ValidateOptions|bool
  Get / set the field empty option
inst() : Editor|Field|Join|Upload
  Static method to instantiate a new instance of a class (shorthand of 'instantiate').
instantiate() : Editor|Field|Join|Upload
  Static method to instantiate a new instance of a class.
message() : ValidateOptions|string
  Get / set the error message to use if validation fails
optional() : ValidateOptions|bool
  Get / set the field optional option
_getSet() : mixed
  Common getter / setter function for DataTables classes.
_propExists() : bool
  Determine if a property is available in a data set (allowing `null` to be a valid value)
_readProp() : mixed
  Read a value from a data structure, using Javascript dotted object notation. This is the inverse of the `_writeProp` method and provides the same support, matching DataTables' ability to read nested JSON data objects.
_writeProp() : mixed
  Write the field's value to an array structure, using Javascript dotted object notation to indicate JSON data structure. For example `name.first` gives the data structure: `name: { first: ... }`. This matches DataTables own ability to do this on the client-side, although this doesn't implement implement quite such a complex structure (no array / function support).

### Methods

#### __construct()

ValidateOptions.php : 26
`public __construct([mixed $opts = null ]) : mixed`

##### Parameters

$opts : mixed = null

##### Return values

mixed —

#### allowEmpty()

ValidateOptions.php : 64

Get / set the field empty option

`public allowEmpty([bool $empty = null ]) : ValidateOptions|bool`

##### Parameters

$empty : bool = null

  `false` if the field is not allowed to be empty. `true` if it can be.

##### Return values

ValidateOptions|bool —

Self if setting, current value if getting.

#### inst()

Ext.php : 51

Static method to instantiate a new instance of a class (shorthand of 'instantiate').

`public static inst() : Editor|Field|Join|Upload`

This method performs exactly the same actions as the 'instantiate' static method, but is simply shorter and easier to type!

##### Return values

Editor|Field|Join|Upload —

class @static

#### instantiate()

Ext.php : 32

Static method to instantiate a new instance of a class.

`public static instantiate() : Editor|Field|Join|Upload`

A factory method that will create a new instance of the class that has extended 'Ext'. This allows classes to be instantiated and then chained - which otherwise isn't available until PHP 5.4. If using PHP 5.4 or later, simply create a 'new' instance of the target class and chain methods as normal.

##### Return values

Editor|Field|Join|Upload —

Instantiated class @static

#### message()

ValidateOptions.php : 49

Get / set the error message to use if validation fails

`public message([string $msg = null ]) : ValidateOptions|string`

##### Parameters

$msg : string = null

  Error message to use. If not given, the currently set message will be returned.

##### Return values

ValidateOptions|string —

Self if setting, message if getting.

#### optional()

ValidateOptions.php : 79

Get / set the field optional option

`public optional([bool $optional = null ]) : ValidateOptions|bool`

##### Parameters

$optional : bool = null

  `false` if the field does not need to be submitted. `true` if it must be.

##### Return values

ValidateOptions|bool —

Self if setting, current value if getting.

#### _getSet()

Ext.php : 75

Common getter / setter function for DataTables classes.

`protected _getSet(mixed &$prop, mixed $val[, mixed $array = false ]) : mixed`

This getter / setter method makes building getter / setting methods easier, by abstracting everything to a single function call.

##### Parameters

$prop : mixed

  The property to set @param mixed $val The value to set - if given as null, then we assume that the function is being used as a getter. @param boolean $array Treat the target property as an array or not (default false). If used as an array, then values passed in are added to the $prop array. @return self|mixed Class instance if setting (allowing chaining), or the value requested if getting.

$val : mixed
$array : mixed = false

##### Return values

mixed —

#### _propExists()

Ext.php : 105

Determine if a property is available in a data set (allowing `null` to be a valid value)

`protected _propExists(string $name, array<string|int, mixed> $data) : bool`

##### Parameters

$name : string

  Javascript dotted object name to write to

$data : array<string|int, mixed>

  Data source array to read from

##### Tags

private

##### Return values

bool —

true if present, false otherwise

#### _readProp()

Ext.php : 142

Read a value from a data structure, using Javascript dotted object notation. This is the inverse of the `_writeProp` method and provides the same support, matching DataTables' ability to read nested JSON data objects.

`protected _readProp(string $name, array<string|int, mixed> $data) : mixed`

##### Parameters

$name : string

  Javascript dotted object name to write to

$data : array<string|int, mixed>

  Data source array to read from

##### Tags

private

##### Return values

mixed —

The read value, or null if no value found.

#### _writeProp()

Ext.php : 186

Write the field's value to an array structure, using Javascript dotted object notation to indicate JSON data structure. For example `name.first` gives the data structure: `name: { first: ... }`. This matches DataTables own ability to do this on the client-side, although this doesn't implement implement quite such a complex structure (no array / function support).

`protected _writeProp(array<string|int, mixed> &$out, string $name, mixed $value) : mixed`

##### Parameters

$out : array<string|int, mixed>

  Array to write the data to

$name : string

  Javascript dotted object name to write to

$value : mixed

  Value to write

##### Tags

throws
  Exception

  Information about duplicate properties

private

##### Return values

mixed —

## Search results