Skip to content

Typecast ​

Type
Final Class
Namespace
craft\helpers
Inherits
craft\helpers\Typecast
Since
4.0.0

Typecast Helper

View source

Public Methods ​

MethodDescription
properties()Typecasts the given property values based on their type declarations.

properties() ​

Typecasts the given property values based on their type declarations.

View source

Arguments ​

  • $class (string) – The class name
  • $properties (array) – The property values

Constants ​

ConstantDescription
TYPE_ARRAY
TYPE_BOOL
TYPE_DATETIME
TYPE_FLOAT
TYPE_INT
TYPE_INT_FLOAT
TYPE_NULL
TYPE_STRING