class RelationOfType implements CompoundType, LateResolvableType

The relationship a model's relation path names, written relation-of<TModel, 'path'>.

Traits

LateResolvableTypeTrait

Methods

__construct(Type $model, Type $key)

Create a relation-of type.

Type
getResult()

Resolve the relationship type, or a relation of unknown models.

array
resolveRelations()

Resolve the relationships the paths name.

bool
isResolvable()

Determine whether the type can be resolved, which waits for its template types.

array
getReferencedClasses()

Get the classes the type refers to.

array
getReferencedTemplateTypes(TemplateTypeVariance $positionVariance)

Get the template types the type refers to.

bool
equals(Type $type)

Determine whether the type equals another.

string
describe(VerbosityLevel $level)

Describe the type.

Type
traverse(callable $cb)

Map the inner types.

Type
traverseSimultaneously(Type $right, callable $cb)

Map the inner types together with another relation-of type's.

TypeNode
toPhpDocNode()

Convert the type to a PHPDoc node.

Type
generalize(GeneralizePrecision $precision)

Generalize the inner types.

Details

at line 44
__construct(Type $model, Type $key)

Create a relation-of type.

Parameters

Type $model
Type $key

at line 51
protected Type getResult()

Resolve the relationship type, or a relation of unknown models.

Return Value

Type

at line 85
array resolveRelations()

internal  
 

Resolve the relationships the paths name.

Unlike upstream, a path that does not resolve is unknown rather than missing, kept beside the paths that do: the name can be a non-constant string, belong to an abstract model, or name a relation that resolveRelationUsing() registers at boot.

Return Value

array

the relationship type of the paths that resolve, and whether any path does not

at line 153
bool isResolvable()

Determine whether the type can be resolved, which waits for its template types.

Return Value

bool

at line 163
array getReferencedClasses()

Get the classes the type refers to.

Return Value

array

at line 173
array getReferencedTemplateTypes(TemplateTypeVariance $positionVariance)

Get the template types the type refers to.

Parameters

TemplateTypeVariance $positionVariance

Return Value

array

at line 188
bool equals(Type $type)

Determine whether the type equals another.

Parameters

Type $type

Return Value

bool

at line 196
string describe(VerbosityLevel $level)

Describe the type.

Parameters

VerbosityLevel $level

Return Value

string

at line 206
Type traverse(callable $cb)

Map the inner types.

Parameters

callable $cb

Return Value

Type

at line 217
Type traverseSimultaneously(Type $right, callable $cb)

Map the inner types together with another relation-of type's.

Parameters

Type $right
callable $cb

Return Value

Type

at line 232
TypeNode toPhpDocNode()

Convert the type to a PHPDoc node.

Return Value

TypeNode

at line 240
Type generalize(GeneralizePrecision $precision)

Generalize the inner types.

Parameters

GeneralizePrecision $precision

Return Value

Type