ManagerService
Provides a service for adding new manager classes. This service is run in functions.php.
Tags
Table of Contents
- $container : ContainerInterface
- $instance : mixed
- $managers : SplObjectStorage
- $request : Request
- add() : self
- Add a WordpressManager to the pipeline.
- addAll() : self
- Add an array of managers.
- addAllCommands() : self
- Add an array of Commands.
- addCommand() : self
- Add a WP CLI command.
- instance() : ManagerService
- run() : void
- Run managers.
- __construct() : mixed
- The constructor is private, use instance() instead.
- exitOnError() : void
- logError() : string
Properties
$container
private
ContainerInterface
$container
$instance
private
static mixed
$instance
$managers
private
SplObjectStorage
$managers
$request
private
Request
$request
Methods
add()
Add a WordpressManager to the pipeline.
public
add(string $className) : self
Parameters
- $className : string
Return values
self —addAll()
Add an array of managers.
public
addAll(array<string|int, mixed> $classNameList) : self
Parameters
- $classNameList : array<string|int, mixed>
Return values
self —addAllCommands()
Add an array of Commands.
public
addAllCommands(array<string|int, mixed> $classNames) : self
Parameters
- $classNames : array<string|int, mixed>
Return values
self —addCommand()
Add a WP CLI command.
public
addCommand(string $className[, mixed $attachToAction = 'init' ]) : self
Parameters
- $className : string
- $attachToAction : mixed = 'init'
Return values
self —instance()
public
static instance() : ManagerService
Return values
ManagerService —run()
Run managers.
public
run() : void
Return values
void —__construct()
The constructor is private, use instance() instead.
private
__construct(Request $request, ContainerInterface $container) : mixed
Parameters
- $request : Request
- $container : ContainerInterface
Return values
mixed —exitOnError()
private
exitOnError(string $message[, string $title = 'Error' ][, int $statusCode = 500 ]) : void
Parameters
- $message : string
- $title : string = 'Error'
- $statusCode : int = 500
Return values
void —logError()
private
logError(string $message) : string
Parameters
- $message : string