- __construct() -- DataValidation constructor
- custom() -- Make data validation as a custom rule
- date() -- Make data validation as a date value
- decimal() -- Make data validation as a decimal value
- dropDown() -- Make data validation as a dropdown list
- integer() -- Make data validation as an integer value
- list() -- Alias of dropDown()
- make() -- Make a DataValidation instance
- isNumber() -- Checking if a cell value is a number
- isText() -- Checking if a cell value is a text
- textLength() -- Make data validation as a text length
- whole() -- Alias of integer()
- allowBlank() -- Allow blank value
- getAttributes()
- setError() -- Set error message (title and body)
- setErrorMessage() -- Error message body
- setErrorStyle() -- Error style (action in case of error)
- setErrorTitle() -- Error message title
- setFormula() -- Alias of setFormula1()
- setFormula1() -- Set formula 1 for data validation
- setFormula2() -- Set formula 2 for data validation
- setOperator()
- setPrompt() -- Set prompt
- showDropDown() -- Show dropdown list
- showErrorMessage() -- Allow (or disallow) error message
- showInputMessage() -- Show input message
- setSqref()
- toXml()
public function __construct($type)
DataValidation constructor
$type
public static function custom(string $formula): DataValidation
Make data validation as a custom rule
string $formula
public static function date(string $operator, $formulas): DataValidation
Make data validation as a date value
string $operator
string|int|array $formulas
public static function decimal(string $operator, $formulas): DataValidation
Make data validation as a decimal value
string $operator
string|int|array $formulas
public static function dropDown($formulas): DataValidation
Make data validation as a dropdown list
array|string $formulas
public static function integer(string $operator, $formulas): DataValidation
Make data validation as an integer value
string $operator
string|int|array $formulas
public static function list($formulas): DataValidation
Alias of dropDown()
array|string $formulas
public static function make($type): DataValidation
Make a DataValidation instance
$type
public static function isNumber(): DataValidation
Checking if a cell value is a number
None
public static function isText(): DataValidation
Checking if a cell value is a text
None
public static function textLength(string $operator, $formulas): DataValidation
Make data validation as a text length
string $operator
array|string $formulas
public static function whole(string $operator, $formulas): DataValidation
Alias of integer()
string $operator
string|int|array $formulas
public function allowBlank(?bool $allowBlank = true): DataValidation
Allow blank value
bool $allowBlank
public function getAttributes(): array
None
public function setError(string $errorMessage,
?string $errorTitle = null): DataValidation
Set error message (title and body)
string $errorMessage
string|null $errorTitle
public function setErrorMessage(string $error): DataValidation
Error message body
string $error
public function setErrorStyle(string $errorStyle): DataValidation
Error style (action in case of error)
string $errorStyle
public function setErrorTitle(string $errorTitle): DataValidation
Error message title
string $errorTitle
public function setFormula($formula): DataValidation
Alias of setFormula1()
int|float|string|array|null $formula
public function setFormula1($formula): DataValidation
Set formula 1 for data validation
int|float|string|array|null $formula
public function setFormula2($formula): DataValidation
Set formula 2 for data validation
int|float|string|array|null $formula
public function setOperator(string $operator, $formula1,
$formula2): DataValidation
string $operator
$formula1
$formula2
public function setPrompt(string $promptMessage,
?string $promptTitle = null): DataValidation
Set prompt
string $promptMessage
string|null $promptTitle
public function showDropDown(?bool $showDropDown = true): DataValidation
Show dropdown list
bool $showDropDown
public function showErrorMessage(?bool $showErrorMessage = true): DataValidation
Allow (or disallow) error message
bool $showErrorMessage
public function showInputMessage(?bool $showInputMessage = true): DataValidation
Show input message
bool|null $showInputMessage
public function setSqref(string $sqref): DataValidation
string $sqref
public function toXml($formulaConverter): string
$formulaConverter