Overview

Namespaces

  • Charcoal
    • Object
    • User
      • Acl

Classes

  • Content
  • ObjectRevision
  • ObjectRoute
  • ObjectSchedule
  • UserData

Interfaces

  • ArchivableInterface
  • CategorizableInterface
  • CategorizableMultipleInterface
  • CategoryInterface
  • ContentInterface
  • HierarchicalInterface
  • ObjectRevisionInterface
  • ObjectRouteInterface
  • ObjectScheduleInterface
  • PublishableInterface
  • RevisionableInterface
  • RoutableInterface
  • UserDataInterface

Traits

  • ArchivableTrait
  • CategorizableMultipleTrait
  • CategorizableTrait
  • CategoryTrait
  • HierarchicalTrait
  • PublishableTrait
  • RevisionableTrait
  • RoutableTrait
  • Overview
  • Namespace
  • Class

Class ObjectRoute

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'
Charcoal\Model\AbstractModel
Extended by Charcoal\Object\ObjectRoute implements Charcoal\Object\ObjectRouteInterface
Namespace: Charcoal\Object
Located at Charcoal/Object/ObjectRoute.php
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

Charcoal\Object\ObjectRouteInterface::isSlugUnique()
public Charcoal\Object\ObjectRoute
# generateUniqueSlug( )

Generate a unique URL slug for routable object.

Generate a unique URL slug for routable object.

Returns

Charcoal\Object\ObjectRoute

Implementation of

Charcoal\Object\ObjectRouteInterface::generateUniqueSlug()
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

Charcoal\Object\ObjectRoute
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

Charcoal\Object\ObjectRoute
public Charcoal\Object\ObjectRoute
# setSlug( string $slug )

Set the object route URI.

Set the object route URI.

Parameters

$slug
The route.

Returns

Charcoal\Object\ObjectRoute
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

Charcoal\Object\ObjectRoute
public Charcoal\Object\ObjectRoute
# setCreationDate( DateTime|string|null $creationDate )

Parameters

$creationDate
The Creation Date date/time.

Returns

Charcoal\Object\ObjectRoute

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

Charcoal\Object\ObjectRoute

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

$type
The object type.

Returns

Charcoal\Object\ObjectRoute
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

$id
The object ID.

Returns

Charcoal\Object\ObjectRoute
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

Charcoal\Object\ObjectRoute
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

Charcoal\Object\ObjectRouteInterface::slug()
public string
# lang( )

Retrieve the locale of the object route.

Retrieve the locale of the object route.

Returns

string

Implementation of

Charcoal\Object\ObjectRouteInterface::lang()
public DateTime
# creationDate( )

Creation date.

Creation date.

Returns

DateTime
Creation date.
public DateTime
# lastModificationDate( )

Last modification date.

Last modification date.

Returns

DateTime
Last modification date.
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

Charcoal\Object\ObjectRouteInterface::routeObjType()
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

Charcoal\Object\ObjectRouteInterface::routeObjId()
public string
# routeTemplate( )

Retrieve the foreign object's template identifier.

Retrieve the foreign object's template identifier.

Returns

string

Implementation of

Charcoal\Object\ObjectRouteInterface::routeTemplate()
public string
# __toString( )

Alias of self::slug().

Alias of self::slug().

Returns

string
Properties summary
protected boolean $active

A route is active by default.

A route is active by default.

# true
protected string $slug

The route's URI.

The route's URI.

#
protected string $lang

The route's locale.

The route's locale.

#
protected DateTime $creationDate

The creation timestamp.

The creation timestamp.

#
protected DateTime $lastModificationDate

The last modification timestamp.

The last modification timestamp.

#
protected string $routeObjType

The foreign object type related to this route.

The foreign object type related to this route.

#
protected mixed $routeObjId

The foreign object ID related to this route.

The foreign object ID related to this route.

#
protected string $routeTemplate

The foreign object's template identifier.

The foreign object's template identifier.

#
API documentation generated by ApiGen