class CollectionOfType implements CompoundType, LateResolvableType

The collection a model's queries return, written collection-of or collection-of<TKey, TModel>.

Traits

LateResolvableTypeTrait

Methods

__construct(Type $type, CollectionHelper $collectionHelper, Type|null $keyType = null)

Create a collection-of type.

Type
getResult()

Resolve the collection class of each model the type stands for.

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 collection-of type's.

TypeNode
toPhpDocNode()

Convert the type to a PHPDoc node.

Type
generalize(GeneralizePrecision $precision)

Generalize the inner types.

Details

at line 40
__construct(Type $type, CollectionHelper $collectionHelper, Type|null $keyType = null)

Create a collection-of type.

Parameters

Type $type
CollectionHelper $collectionHelper
Type|null $keyType

at line 47
protected Type getResult()

Resolve the collection class of each model the type stands for.

Return Value

Type

at line 74
bool isResolvable()

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

Return Value

bool

at line 85
array getReferencedClasses()

Get the classes the type refers to.

Return Value

array

at line 95
array getReferencedTemplateTypes(TemplateTypeVariance $positionVariance)

Get the template types the type refers to.

Parameters

TemplateTypeVariance $positionVariance

Return Value

array

at line 110
bool equals(Type $type)

Determine whether the type equals another.

Parameters

Type $type

Return Value

bool

at line 126
string describe(VerbosityLevel $level)

Describe the type.

Parameters

VerbosityLevel $level

Return Value

string

at line 140
Type traverse(callable $cb)

Map the inner types.

Parameters

callable $cb

Return Value

Type

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

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

Parameters

Type $right
callable $cb

Return Value

Type

at line 174
TypeNode toPhpDocNode()

Convert the type to a PHPDoc node.

Return Value

TypeNode

at line 186
Type generalize(GeneralizePrecision $precision)

Generalize the inner types.

Parameters

GeneralizePrecision $precision

Return Value

Type