Skip to content

Latest commit

 

History

History
467 lines (291 loc) · 6.56 KB

95-api-class-data-validation.md

File metadata and controls

467 lines (291 loc) · 6.56 KB

Class \avadim\FastExcelWriter\DataValidation\DataValidation



__construct()


public function __construct($type)

DataValidation constructor

Parameters

  • $type

custom()


public static function custom(string $formula): DataValidation

Make data validation as a custom rule

Parameters

  • string $formula

date()


public static function date(string $operator, $formulas): DataValidation

Make data validation as a date value

Parameters

  • string $operator
  • string|int|array $formulas

decimal()


public static function decimal(string $operator, $formulas): DataValidation

Make data validation as a decimal value

Parameters

  • string $operator
  • string|int|array $formulas

dropDown()


public static function dropDown($formulas): DataValidation

Make data validation as a dropdown list

Parameters

  • array|string $formulas

integer()


public static function integer(string $operator, $formulas): DataValidation

Make data validation as an integer value

Parameters

  • string $operator
  • string|int|array $formulas

list()


public static function list($formulas): DataValidation

Alias of dropDown()

Parameters

  • array|string $formulas

make()


public static function make($type): DataValidation

Make a DataValidation instance

Parameters

  • $type

isNumber()


public static function isNumber(): DataValidation

Checking if a cell value is a number

Parameters

None


isText()


public static function isText(): DataValidation

Checking if a cell value is a text

Parameters

None


textLength()


public static function textLength(string $operator, $formulas): DataValidation

Make data validation as a text length

Parameters

  • string $operator
  • array|string $formulas

whole()


public static function whole(string $operator, $formulas): DataValidation

Alias of integer()

Parameters

  • string $operator
  • string|int|array $formulas

allowBlank()


public function allowBlank(?bool $allowBlank = true): DataValidation

Allow blank value

Parameters

  • bool $allowBlank

getAttributes()


public function getAttributes(): array

Parameters

None


setError()


public function setError(string $errorMessage, 
                         ?string $errorTitle = null): DataValidation

Set error message (title and body)

Parameters

  • string $errorMessage
  • string|null $errorTitle

setErrorMessage()


public function setErrorMessage(string $error): DataValidation

Error message body

Parameters

  • string $error

setErrorStyle()


public function setErrorStyle(string $errorStyle): DataValidation

Error style (action in case of error)

Parameters

  • string $errorStyle

setErrorTitle()


public function setErrorTitle(string $errorTitle): DataValidation

Error message title

Parameters

  • string $errorTitle

setFormula()


public function setFormula($formula): DataValidation

Alias of setFormula1()

Parameters

  • int|float|string|array|null $formula

setFormula1()


public function setFormula1($formula): DataValidation

Set formula 1 for data validation

Parameters

  • int|float|string|array|null $formula

setFormula2()


public function setFormula2($formula): DataValidation

Set formula 2 for data validation

Parameters

  • int|float|string|array|null $formula

setOperator()


public function setOperator(string $operator, $formula1, 
                            $formula2): DataValidation

Parameters

  • string $operator
  • $formula1
  • $formula2

setPrompt()


public function setPrompt(string $promptMessage, 
                          ?string $promptTitle = null): DataValidation

Set prompt

Parameters

  • string $promptMessage
  • string|null $promptTitle

showDropDown()


public function showDropDown(?bool $showDropDown = true): DataValidation

Show dropdown list

Parameters

  • bool $showDropDown

showErrorMessage()


public function showErrorMessage(?bool $showErrorMessage = true): DataValidation

Allow (or disallow) error message

Parameters

  • bool $showErrorMessage

showInputMessage()


public function showInputMessage(?bool $showInputMessage = true): DataValidation

Show input message

Parameters

  • bool|null $showInputMessage

setSqref()


public function setSqref(string $sqref): DataValidation

Parameters

  • string $sqref

toXml()


public function toXml($formulaConverter): string

Parameters

  • $formulaConverter