class GenericModelPropertyType extends StringType

A string naming a database property of a model, written model-property.

Methods

__construct(Type $type, ModelPropertyHelper $modelPropertyHelper)

Create a new generic model property type instance.

string
describe(VerbosityLevel $level)

Describe the type.

array
getReferencedClasses()

Get the classes the type refers to.

Type
getGenericType()

Get the model type whose properties the string names.

bool
equals(Type $type)

Determine whether the type equals another.

AcceptsResult
accepts(Type $type, bool $strictTypes)

Determine whether the type accepts another, checking a constant string against the model's properties.

IsSuperTypeOfResult
isSuperTypeOf(Type $type)

Determine whether the type is a supertype of another.

Type
traverse(callable $cb)

Map the model type through a callback.

TemplateTypeMap
inferTemplateTypes(Type $receivedType)

Infer the model template type from a received type.

array
getReferencedTemplateTypes(TemplateTypeVariance $positionVariance)

Get the template types the model type refers to.

bool
hasTemplateOrLateResolvableType()

Determine whether the type has template or late-resolvable parts.

static Type
__set_state(array $properties)

Restore the type from var_export() output.

Details

at line 38
__construct(Type $type, ModelPropertyHelper $modelPropertyHelper)

Create a new generic model property type instance.

Parameters

Type $type
ModelPropertyHelper $modelPropertyHelper

at line 46
string describe(VerbosityLevel $level)

Describe the type.

Parameters

VerbosityLevel $level

Return Value

string

at line 56
array getReferencedClasses()

Get the classes the type refers to.

Return Value

array

at line 64
Type getGenericType()

Get the model type whose properties the string names.

Return Value

Type

at line 72
bool equals(Type $type)

Determine whether the type equals another.

Parameters

Type $type

Return Value

bool

at line 82
AcceptsResult accepts(Type $type, bool $strictTypes)

Determine whether the type accepts another, checking a constant string against the model's properties.

A "table.column" string is checked against that table on the model's connection.

Parameters

Type $type
bool $strictTypes

Return Value

AcceptsResult

at line 153
IsSuperTypeOfResult isSuperTypeOf(Type $type)

Determine whether the type is a supertype of another.

Parameters

Type $type

Return Value

IsSuperTypeOfResult

at line 179
Type traverse(callable $cb)

Map the model type through a callback.

Parameters

callable $cb

Return Value

Type

at line 193
TemplateTypeMap inferTemplateTypes(Type $receivedType)

Infer the model template type from a received type.

Parameters

Type $receivedType

Return Value

TemplateTypeMap

at line 230
array getReferencedTemplateTypes(TemplateTypeVariance $positionVariance)

Get the template types the model type refers to.

Parameters

TemplateTypeVariance $positionVariance

Return Value

array

at line 240
bool hasTemplateOrLateResolvableType()

Determine whether the type has template or late-resolvable parts.

Return Value

bool

at line 250
static Type __set_state(array $properties)

Restore the type from var_export() output.

Parameters

array $properties

Return Value

Type