ResourceTypeField
abstract class ResourceTypeField (View source)
| internal | JSON:API maintains no PHP API since its API is the HTTP API. This class may change at any time and this will break any dependencies on it. |
Abstract value object containing all metadata for a JSON:API resource field.
Properties
| protected string | $internalName | The internal field name. |
|
| protected string | $publicName | The public field name. |
|
| protected bool | $enabled | Whether the field is disabled. |
|
| protected bool | $hasOne | Whether the field can only have one value. |
Methods
ResourceTypeField constructor.
Gets the internal name of the field.
Gets the public name of the field.
Establishes a new public name for the field.
Gets a new instance of the field that is disabled.
Whether the field is enabled.
Whether the field can only have one value.
Whether the field can have many values.
Details
__construct(string $internal_name, string $public_name = NULL, bool $enabled = TRUE, bool $has_one = TRUE)
ResourceTypeField constructor.
string
getInternalName()
Gets the internal name of the field.
string
getPublicName()
Gets the public name of the field.
ResourceTypeField
withPublicName(string $public_name)
Establishes a new public name for the field.
ResourceTypeField
disabled()
Gets a new instance of the field that is disabled.
bool
isFieldEnabled()
Whether the field is enabled.
bool
hasOne()
Whether the field can only have one value.
bool
hasMany()
Whether the field can have many values.