5.3 KiB
title, weight
| title | weight |
|---|---|
| Internal structures | 11 |
This package has some internal structures which are used to analyze data objects and their properties. They can be helpful when writing casts, transformers or rule inferrers.
DataClass
The DataClass represents the structure of a data object and has the following properties:
namethe name of the data classpropertiesall theDataProperty's of the class (more on that later)methodsall the magical creationDataMethods of the class (more on that later)constructorMethodthe constructorDataMethodof the classisReadOnlyis the class read onlyisAbstractis the class abstractappendableis the class implementingAppendableDataincludeableis the class implementingIncludeableDataresponsableis the class implementingResponsableDatatransformableis the class implementingTransformableDatavalidatableis the class implementingValidatableDatawrappableis the class implementingWrappableDataemptyDatathe the class implementingEmptyDataattributesa collection of resolved attributes assigned to the classdataCollectablePropertyAnnotationsthe property annotations of the class used to infer the data collection typeallowedRequestIncludesthe allowed request includes of the classallowedRequestExcludesthe allowed request excludes of the classallowedRequestOnlythe allowed request only of the classallowedRequestExceptthe allowed request except of the classoutputMappedPropertiesproperties names which are mapped when transforming the data objecttransformationFieldsstructure of the transformation fields
DataProperty
A data property represents a single property within a data object.
namethe name of the propertyclassNamethe name of the class of the propertytypetheDataPropertyTypeof the property (more on that later)validateshould the property be automatically validatedcomputedis the property computedhiddenwill the property be hidden when transforming the data objectisPromotedis the property constructor promotedisReadOnlyis the property read onlyhasDefaultValuehas the property a default valuedefaultValuethe default value of the propertycastthe cast assigned to the propertytransformerthe transformer assigned to the propertyinputMappedNamethe name used to map a property name givenoutputMappedNamethe name used to map a property name ontoattributesa collection of resolved attributes assigned to the property
DataMethod
A data method represents a method within a data object.
namethe name of the methodparametersall theDataParameter's andDataPropertys of the method (more on that later)isStaticwhether the method is staticisPublicwhether the method is publicisCustomCreationMethodwhether the method is a custom creation method (=magical creation method)returnTypetheDataTypeof the return value (more on that later)
DataParameter
A data parameter represents a single parameter/property within a data method.
namethe name of the parameterisPromotedis the property/parameter constructor promotedhasDefaultValuehas the parameter a default valuedefaultValuethe default value of the parametertypetheDataTypeof the parameter (more on that later)
DataType
A data type represents a type within a data object.
Typecan be aNamedType,UnionTypeorIntersectionType(more on that later)isNullablecan the type be nullableisMixedis the type a mixed typekindtheDataTypeKindof the type (more on that later)
DataPropertyType
Extends from the DataType and has the following additional properties:
isOptionalcan the type be optionallazyTypethe class of the lazy type for the propertydataClassthe data object class of the property or the data object class of the collection it collectsdataCollectableClassthe collectable type of the data objectskindtheDataTypeKindof the type (more on that later)
DataTypeKind
An enum representing the kind of type of a property/parameter with respect to the package:
- Default: a non package specific type
- DataObject: a data object
- DataCollection: a
DataCollectionof data objects - DataPaginatedCollection: a
DataPaginatedCollectionof data objects - DataCursorPaginatedCollection: a
DataCursorPaginatedCollectionof data objects - DataArray: an array of data objects
- DataEnumerable: a
Enumerableof data objects - DataPaginator: a
Paginatorof data objects - DataCursorPaginator: a
CursorPaginatorof data objects
NamedType
Represents a named PHP type with the following properties:
namethe name of the typebuiltInis the type a built-in typeacceptedTypesan array of accepted types as stringkindtheDataTypeKindof the type (more on that later)dataClassthe data object class of the property or the data object class of the collection it collectsdataCollectableClassthe collectable type of the data objectsisCastablewetter the type is aCastable
UnionType / IntersectionType
Represents a union or intersection of types with the following properties:
typesan array of types (can beNamedType,UnionTypeorIntersectionType)