class MatcherDumper implements MatcherDumperInterface (View source)

Dumps Route information to a database table.

Properties

protected Connection $connection

The database connection to which to dump route information.

protected RouteCollection $routes

The routes to be dumped.

protected StateInterface $state

The state.

protected string $tableName

The name of the SQL table to which to dump the routes.

Methods

__construct(Connection $connection, StateInterface $state, string $table = 'router')

Construct the MatcherDumper.

addRoutes(RouteCollection $routes)

Adds additional routes to be dumped.

dump(array $options = [])

Dumps a set of routes to the router table in the database.

RouteCollection
getRoutes()

Gets the routes to match.

bool
ensureTableExists()

Checks if the tree table exists and create it if not.

array
schemaDefinition()

Defines the schema for the router table.

Details

__construct(Connection $connection, StateInterface $state, string $table = 'router')

Construct the MatcherDumper.

Parameters

Connection $connection

The database connection which will be used to store the route information.

StateInterface $state

The state.

string $table

(optional) The table to store the route info in. Defaults to 'router'.

addRoutes(RouteCollection $routes)

Adds additional routes to be dumped.

Parameters

RouteCollection $routes

A collection of routes to add to this dumper.

dump(array $options = [])

Dumps a set of routes to the router table in the database.

Available options:

  • provider: The route grouping that is being dumped. All existing routes with this provider will be deleted on dump.
  • base_class: The base class name.

Parameters

array $options

An array of options.

Exceptions

Exception

RouteCollection getRoutes()

Gets the routes to match.

Return Value

RouteCollection

A RouteCollection instance representing all routes currently in the dumper.

protected bool ensureTableExists()

Checks if the tree table exists and create it if not.

Return Value

bool

TRUE if the table was created, FALSE otherwise.

protected array schemaDefinition()

internal  
 

Defines the schema for the router table.

Return Value

array

The schema API definition for the SQL storage table.