Bristol SU Support Package
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
BristolSU\Support\Action\RegisteredAction Class Reference
Inheritance diagram for BristolSU\Support\Action\RegisteredAction:
Inheritance graph
[legend]
Collaboration diagram for BristolSU\Support\Action\RegisteredAction:
Collaboration graph
[legend]

Public Member Functions

 setName (string $name)
 
 getName ()
 
 setDescription (string $description)
 
 getDescription ()
 
 setClassName (string $className)
 
 getClassName ()
 
 toArray ()
 
 toJson ($options=0)
 
 __toString ()
 

Static Public Member Functions

static fromArray (array $parameters)
 

Private Attributes

 $name
 
 $description
 
 $className
 

Detailed Description

Definition at line 13 of file RegisteredAction.php.

Member Function Documentation

◆ __toString()

BristolSU\Support\Action\RegisteredAction::__toString ( )

Transform the action to json when casting class to a string

Returns
string

Definition at line 152 of file RegisteredAction.php.

References BristolSU\Support\Action\RegisteredAction\toJson().

◆ fromArray()

static BristolSU\Support\Action\RegisteredAction::fromArray ( array  $parameters)
static

Create a RegisteredAction instance from a raw metadata array.

Creates a RegisteredAction instance from an array of the form [ 'name' => 'Action Name', 'description' => 'Action Description', 'class' => 'ClassName' ]

Parameters
array$parametersThe raw metadata of the action
Returns

Implements BristolSU\Support\Action\Contracts\RegisteredAction.

Definition at line 113 of file RegisteredAction.php.

Referenced by BristolSU\Support\Action\ActionRepository\all(), and BristolSU\Support\Action\ActionRepository\fromClass().

◆ getClassName()

BristolSU\Support\Action\RegisteredAction::getClassName ( )

Get the class name of the action

Returns
string

Implements BristolSU\Support\Action\Contracts\RegisteredAction.

Definition at line 95 of file RegisteredAction.php.

References BristolSU\Support\Action\RegisteredAction\$className.

Referenced by BristolSU\Support\Action\RegisteredAction\toArray().

◆ getDescription()

BristolSU\Support\Action\RegisteredAction::getDescription ( )

Get the description of the action.

Returns
string Description

Implements BristolSU\Support\Action\Contracts\RegisteredAction.

Definition at line 74 of file RegisteredAction.php.

References BristolSU\Support\Action\RegisteredAction\$description.

Referenced by BristolSU\Support\Action\RegisteredAction\toArray().

◆ getName()

BristolSU\Support\Action\RegisteredAction::getName ( )

Get the name of the action.

Returns
string Name

Implements BristolSU\Support\Action\Contracts\RegisteredAction.

Definition at line 53 of file RegisteredAction.php.

References BristolSU\Support\Action\RegisteredAction\$name.

Referenced by BristolSU\Support\Action\RegisteredAction\toArray().

◆ setClassName()

BristolSU\Support\Action\RegisteredAction::setClassName ( string  $className)

Set the class name of the action.

Parameters
string$classNameClass of the action
Returns
void

Implements BristolSU\Support\Action\Contracts\RegisteredAction.

Definition at line 85 of file RegisteredAction.php.

References BristolSU\Support\Action\RegisteredAction\$className.

◆ setDescription()

BristolSU\Support\Action\RegisteredAction::setDescription ( string  $description)

Set the description of the action.

Parameters
string$descriptionName of the description
Returns
void

Implements BristolSU\Support\Action\Contracts\RegisteredAction.

Definition at line 64 of file RegisteredAction.php.

References BristolSU\Support\Action\RegisteredAction\$description.

◆ setName()

BristolSU\Support\Action\RegisteredAction::setName ( string  $name)

Set the name of the action.

Parameters
string$nameName of the action
Returns
void

Implements BristolSU\Support\Action\Contracts\RegisteredAction.

Definition at line 43 of file RegisteredAction.php.

References BristolSU\Support\Action\RegisteredAction\$name.

◆ toArray()

BristolSU\Support\Action\RegisteredAction::toArray ( )

◆ toJson()

BristolSU\Support\Action\RegisteredAction::toJson (   $options = 0)

Transform the action to json

Parameters
int$options
Returns
string

Implements BristolSU\Support\Action\Contracts\RegisteredAction.

Definition at line 142 of file RegisteredAction.php.

References BristolSU\Support\Action\RegisteredAction\toArray().

Referenced by BristolSU\Support\Action\RegisteredAction\__toString().

Member Data Documentation

◆ $className

BristolSU\Support\Action\RegisteredAction::$className
private

◆ $description

BristolSU\Support\Action\RegisteredAction::$description
private

◆ $name

BristolSU\Support\Action\RegisteredAction::$name
private

The documentation for this class was generated from the following file: