Represents a route to an object (i.e., a permalink).
Intended to be used to collect all routes related to models
under a single source (e.g., database table).
Charcoal\Object\ObjectRevision
for a similar model that aggregates data
under a common source.
Requirements:
- 'model/factory'
- 'model/collection/loader'
Methods summary
public
|
#
setDependencies( Pimple\Container $container )
Inject dependencies from a DI Container.
Inject dependencies from a DI Container.
Parameters
- $container
- A dependencies container instance.
|
public
boolean
|
#
preSave( )
Event called before creating the object.
Event called before creating the object.
Returns
boolean
See
Charcoal\Source\StorableTrait::preSave() For the "create" Event.
|
public
boolean
|
#
preUpdate( array $properties = null )
Event called before updating the object.
Event called before updating the object.
Parameters
- $properties
- Optional. The list of properties to update.
Returns
boolean
See
Charcoal\Source\StorableTrait::preUpdate() For the "update" Event.
|
public
boolean
|
#
isSlugUnique( )
Determine if the current slug is unique.
Determine if the current slug is unique.
Returns
boolean
Implementation of
|
public
Charcoal\Object\ObjectRoute
|
#
generateUniqueSlug( )
Generate a unique URL slug for routable object.
Generate a unique URL slug for routable object.
Returns
Implementation of
|
protected
Charcoal\Object\ObjectRoute
|
#
setModelFactory( Charcoal\Factory\FactoryInterface $factory )
Set an object model factory.
Set an object model factory.
Parameters
- $factory
- The model factory, to create objects.
Returns
|
protected
Charcoal\Object\ObjectRoute
|
#
setCollectionLoader( Charcoal\Loader\CollectionLoader $loader )
Set a model collection loader.
Set a model collection loader.
Parameters
- $loader
- The collection loader.
Returns
|
public
Charcoal\Object\ObjectRoute
|
#
setSlug( string $slug )
Set the object route URI.
Set the object route URI.
Parameters
Returns
|
public
Charcoal\Object\ObjectRoute
|
#
setLang( string $lang )
Set the locale of the object route.
Set the locale of the object route.
Parameters
- $lang
- The route's locale.
Returns
|
public
Charcoal\Object\ObjectRoute
|
#
setCreationDate( DateTime|string|null $creationDate )
Parameters
- $creationDate
- The Creation Date date/time.
Returns
Throws
InvalidArgumentException If the date/time is invalid.
|
public
Charcoal\Object\ObjectRoute
|
#
setLastModificationDate( DateTime|string|null $lastModificationDate )
Parameters
- $lastModificationDate
- The Last modification date date/time.
Returns
Throws
InvalidArgumentException If the date/time is invalid.
|
public
Charcoal\Object\ObjectRoute
|
#
setRouteObjType( string $type )
Set the foreign object type related to this route.
Set the foreign object type related to this route.
Parameters
Returns
|
public
Charcoal\Object\ObjectRoute
|
#
setRouteObjId( string $id )
Set the foreign object ID related to this route.
Set the foreign object ID related to this route.
Parameters
Returns
|
public
Charcoal\Object\ObjectRoute
|
#
setRouteTemplate( string $template )
Set the foreign object's template identifier.
Set the foreign object's template identifier.
Parameters
- $template
- The template identifier.
Returns
|
public
Charcoal\Factory\FactoryInterface
|
#
modelFactory( )
Retrieve the object model factory.
Retrieve the object model factory.
Returns
Charcoal\Factory\FactoryInterface
Throws
RuntimeException If the model factory was not previously set.
|
public
Charcoal\Loader\CollectionLoader
|
#
collectionLoader( )
Retrieve the model collection loader.
Retrieve the model collection loader.
Returns
Charcoal\Loader\CollectionLoader
Throws
RuntimeException If the collection loader was not previously set.
|
public
string
|
#
slug( )
Retrieve the object route.
Retrieve the object route.
Returns
string
Implementation of
|
public
string
|
#
lang( )
Retrieve the locale of the object route.
Retrieve the locale of the object route.
Returns
string
Implementation of
|
public
DateTime
|
|
public
DateTime
|
|
public
string
|
#
routeObjType( )
Retrieve the foreign object type related to this route.
Retrieve the foreign object type related to this route.
Returns
string
Implementation of
|
public
string
|
#
routeObjId( )
Retrieve the foreign object ID related to this route.
Retrieve the foreign object ID related to this route.
Returns
string
Implementation of
|
public
string
|
#
routeTemplate( )
Retrieve the foreign object's template identifier.
Retrieve the foreign object's template identifier.
Returns
string
Implementation of
|
public
string
|
|