ResourceTypeRelationship
class ResourceTypeRelationship extends 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. |
Specialization of a ResourceTypeField to represent a resource relationship.
Properties
| protected string | $internalName | The internal field name. |
from ResourceTypeField |
| protected string | $publicName | The public field name. |
from ResourceTypeField |
| protected bool | $enabled | Whether the field is disabled. |
from ResourceTypeField |
| protected bool | $hasOne | Whether the field can only have one value. |
from ResourceTypeField |
| protected ResourceType[] | $relatableResourceTypes | The resource type to which this relationships can relate. |
Methods
ResourceTypeField constructor.
Establishes a new public name for the field.
Gets a new instance of the field that is disabled.
Establishes the relatable resource types of this field.
Gets the relatable resource types.
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.
ResourceTypeRelationship
withRelatableResourceTypes(array $resource_types)
Establishes the relatable resource types of this field.
ResourceType[]
getRelatableResourceTypes()
Gets the relatable resource types.