Methods summary
public
Charcoal\Object\RoutableInterface
|
#
setSlugPattern( mixed $pattern )
Set the object's URL slug pattern.
Set the object's URL slug pattern.
Parameters
- $pattern
- The slug pattern.
Returns
|
public
Charcoal\Translation\TranslationString|null
|
#
slugPattern( )
Retrieve the object's URL slug pattern.
Retrieve the object's URL slug pattern.
Returns
Charcoal\Translation\TranslationString|null
Throws
InvalidArgumentException If a slug pattern is not defined.
|
public
Charcoal\Translation\TranslationString|null
|
#
slugPrefix( )
Retrieve route prefix for the object's URL slug pattern.
Retrieve route prefix for the object's URL slug pattern.
Returns
Charcoal\Translation\TranslationString|null
|
public
Charcoal\Translation\TranslationString|null
|
#
slugSuffix( )
Retrieve route suffix for the object's URL slug pattern.
Retrieve route suffix for the object's URL slug pattern.
Returns
Charcoal\Translation\TranslationString|null
|
public
boolean
|
#
isSlugEditable( )
Determine if the slug is editable.
Determine if the slug is editable.
Returns
boolean
|
public
Charcoal\Object\RoutableInterface
|
#
setSlug( mixed $slug )
Set the object's URL slug.
Set the object's URL slug.
Parameters
Returns
|
public
Charcoal\Translation\TranslationString|null
|
#
slug( )
Retrieve the object's URL slug.
Retrieve the object's URL slug.
Returns
Charcoal\Translation\TranslationString|null
|
public
Charcoal\Translation\TranslationString
|
#
generateSlug( )
Generate a URL slug from the object's URL slug pattern.
Generate a URL slug from the object's URL slug pattern.
Returns
Charcoal\Translation\TranslationString
Throws
UnexpectedValueException If the slug is empty.
|
protected
string
|
#
generateRoutePattern( string $pattern )
Generate a route from the given pattern.
Generate a route from the given pattern.
Parameters
- $pattern
- The slug pattern.
Returns
string Returns the generated route.
Uses
|
protected
string
|
#
parseRouteToken( string|array $token )
Parse the given slug (URI token) for the current object.
Parse the given slug (URI token) for the current object.
Parameters
- $token
- The token to parse relative to the model entry.
Returns
string
Throws
InvalidArgumentException If a route token is not a string.
Uses
Used by
Used-by
self::generateRoutePattern() If a view renderer is unavailable.
|
protected
string
|
#
filterRouteToken( mixed $value, string $token = null )
Filter the given value for a URI.
Filter the given value for a URI.
Parameters
- $value
- A value to filter.
- $token
- The parsed token.
Returns
string The filtered $value.
Used by
Used-by
self::parseRouteToken() To resolve the token's value.
|
protected
|
|
protected
Charcoal\Object\ObjectRouteInterface
|
#
getLatestObjectRoute( string|null $lang = null )
Retrieve the latest object route.
Retrieve the latest object route.
Parameters
- $lang
- If object is multilingual, return the object route for the specified locale.
Returns
Throws
InvalidArgumentException If the given language is invalid.
|
public
Charcoal\Translation\TranslationString|string
|
#
url( string|null $lang = null )
Retrieve the object's URI.
Retrieve the object's URI.
Parameters
- $lang
- If object is multilingual, return the object route for the specified locale.
Returns
Charcoal\Translation\TranslationString|string
|
public
string
|
#
slugify( string $str )
Convert a string into a slug.
Convert a string into a slug.
Parameters
- $str
- The string to slugify.
Returns
string The slugified string.
|
protected
string
|
#
finalizeSlug( string $slug )
Finalize slug.
Adds any prefix and suffix defined in the routable configuration set.
Parameters
Returns
string
Throws
UnexpectedValueException If the slug affixes are invalid.
|
protected
boolean
|
#
deleteObjectRoutes( )
Delete all object routes.
Delete all object routes.
Should be called on object deletion \Charcoal\Model\AbstractModel::preDelete().
Returns
boolean Success or failure.
|
public
Charcoal\Object\ObjectRouteInterface
|
|
protected
AbstractPropertyDisplay
|
#
setObjectRouteClass( string $className )
Set the class name of the object route model.
Set the class name of the object route model.
Parameters
- $className
- The class name of the object route model.
Returns
AbstractPropertyDisplay Chainable
Throws
InvalidArgumentException If the class name is not a string.
|
public
string
|
#
objectRouteClass( )
Retrieve the class name of the object route model.
Retrieve the class name of the object route model.
Returns
string
|
abstract public
Charcoal\Factory\FactoryInterface
|
#
modelFactory( )
Retrieve the object model factory.
Retrieve the object model factory.
Returns
Charcoal\Factory\FactoryInterface
|
abstract public
mixed
|
#
templateIdent( )
Retrieve the routable object's template identifier.
Retrieve the routable object's template identifier.
Returns
mixed
|