ModelIdentifier
class ModelIdentifier (View source)
Properties
| static protected | $useMorphMap | Use the Relation morphMap for a Model's name when serializing. |
|
| Model>|string|null | $class | The class name of the model. |
|
| mixed | $id | The unique identifier of the model. |
|
| array | $relations | The relationships loaded on the model. |
|
| string|null | $connection | The connection name of the model. |
|
| Collection>|null | $collectionClass | The class name of the model collection. |
Methods
Create a new model identifier.
Specify the collection class that should be used when serializing / restoring collections.
Get the fully-qualified class name of the Model.
Indicate whether to use the relational morph-map when serializing Models.
Details
__construct(Model>|null $class, mixed $id, array $relations, mixed $connection)
Create a new model identifier.
$this
useCollectionClass(string|null $collectionClass)
Specify the collection class that should be used when serializing / restoring collections.
string|null
getClass()
Get the fully-qualified class name of the Model.
static void
useMorphMap(bool $useMorphMap = true)
Indicate whether to use the relational morph-map when serializing Models.