Orpheus

TypeSlug extends TypeString
in package

Entity Type Slug class

Table of Contents

Properties

$defaultMaxLength  : int
$defaultMinLength  : int
$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
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
validate()  : void
Validate value This should handle a string and the final type, e.g. DateTime for TypeDatetime

Properties

$defaultMaxLength

protected static int $defaultMaxLength = 65535

$defaultMinLength

protected static int $defaultMinLength = 0

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

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

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


							
On this page

Search results