RelationOfType
class RelationOfType implements CompoundType, LateResolvableType
The relationship a model's relation path names, written relation-of<TModel, 'path'>.
Traits
Methods
Create a relation-of type.
Resolve the relationship type, or a relation of unknown models.
Resolve the relationships the paths name.
Determine whether the type can be resolved, which waits for its template types.
Get the classes the type refers to.
Get the template types the type refers to.
Determine whether the type equals another.
Describe the type.
Map the inner types.
Map the inner types together with another relation-of type's.
Convert the type to a PHPDoc node.
Generalize the inner types.
Details
at line 44
__construct(Type $model, Type $key)
Create a relation-of type.
at line 51
protected Type
getResult()
Resolve the relationship type, or a relation of unknown models.
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.
at line 153
bool
isResolvable()
Determine whether the type can be resolved, which waits for its template types.
at line 163
array
getReferencedClasses()
Get the classes the type refers to.
at line 173
array
getReferencedTemplateTypes(TemplateTypeVariance $positionVariance)
Get the template types the type refers to.
at line 188
bool
equals(Type $type)
Determine whether the type equals another.
at line 196
string
describe(VerbosityLevel $level)
Describe the type.
at line 206
Type
traverse(callable $cb)
Map the inner types.
at line 217
Type
traverseSimultaneously(Type $right, callable $cb)
Map the inner types together with another relation-of type's.
at line 232
TypeNode
toPhpDocNode()
Convert the type to a PHPDoc node.
at line 240
Type
generalize(GeneralizePrecision $precision)
Generalize the inner types.