Orpheus

TypeNumber extends AbstractTypeDescriptor
in package

Entity Type Number class

Table of Contents

Properties

$name  : string
The type's name
$nullable  : bool
Is this type nullable ?
$writable  : bool
Is this type writable ?

Methods

__construct()  : mixed
AbstractTypeDescriptor constructor
emptyIsNull()  : bool
Get true if we consider null an empty input string
formatSqlValue()  : mixed
Format programming value into SQL value
formatUserValue()  : string
Format programming value into user value
getHtmlInputAttr()  : array<string|int, string>
Get the html input attributes array for the given Field descriptor
getMaxLengthOf()  : int
Get the max length of number
getName()  : string
Get the type name
htmlInputAttr()  : string
Get the html input attributes string for the given args
isNullable()  : bool
Get true if field is nullable
isWritable()  : bool
Get true if field is writable
parseArgs()  : stdClass
Parse args from field declaration
parseSqlValue()  : mixed
Parse SQL value into programming value
parseUserValue()  : mixed
Parse user value into programming value
preFormat()  : void
Format value before being validated.
validate()  : void
Validate value This should handle a string and the final type, e.g. DateTime for TypeDatetime

Properties

Methods

__construct()

AbstractTypeDescriptor constructor

public __construct(string $name) : mixed
Parameters
$name : string

formatSqlValue()

Format programming value into SQL value

public formatSqlValue(FieldDescriptor $field, string $value) : mixed
Parameters
$field : FieldDescriptor

The field to parse

$value : string

The field value to parse

Tags
noinspection

PhpUnusedParameterInspection

Return values
mixed

(string, null or any special type)

formatUserValue()

Format programming value into user value

public formatUserValue(FieldDescriptor $field, mixed $value) : string
Parameters
$field : FieldDescriptor

The field to parse

$value : mixed

The field value to parse

Tags
noinspection

PhpUnusedParameterInspection

Return values
string

getHtmlInputAttr()

Get the html input attributes array for the given Field descriptor

public getHtmlInputAttr(FieldDescriptor $field) : array<string|int, string>
Parameters
$field : FieldDescriptor
Return values
array<string|int, string>

getMaxLengthOf()

Get the max length of number

public static getMaxLengthOf(int $number, int $decimals) : int
Parameters
$number : int
$decimals : int
Return values
int

htmlInputAttr()

Get the html input attributes string for the given args

public htmlInputAttr(object $args) : string
Parameters
$args : object
Return values
string

parseArgs()

Parse args from field declaration

public parseArgs(array<string|int, string> $rawArgs) : stdClass
Parameters
$rawArgs : array<string|int, string>

Arguments

Return values
stdClass

preFormat()

Format value before being validated.

public preFormat(FieldDescriptor $field, mixed &$value, array<string|int, mixed> $input, PermanentEntity|null &$ref) : void

Validator should allow string and final type (string, object...) Use this function if user/developer could try to validate a validator from another type

Parameters
$field : FieldDescriptor

The field to format

$value : mixed

The field value to format

$input : array<string|int, mixed>

The input to validate

$ref : PermanentEntity|null

The object to update, may be null

validate()

Validate value This should handle a string and the final type, e.g. DateTime for TypeDatetime

public validate(FieldDescriptor $field, mixed &$value, array<string|int, mixed> $input, PermanentEntity|null &$ref) : void
Parameters
$field : FieldDescriptor

The field to validate

$value : mixed

The field value to validate

$input : array<string|int, mixed>

The input to validate

$ref : PermanentEntity|null

The object to update, may be null

Tags
throws
InvalidTypeFormat

							
On this page

Search results