trait CanCleanParameters (View source)

Trait CanCleanParameters

Methods

bool
propertiesPassRequired()

This method checks that all properties marked as required have been assigned a value.

array
propertiesToArray()

This method picks up all the defined properties the $parameterRequired|$parameterOptional property array list from the class object and returns an array containing each list item name as a key and the matching property value from the class

mixed
accessPropertyByKey(string $key)

This method calls the accessors for keys passed in and returns back the value it receives from the class instance

Details

protected bool propertiesPassRequired()

This method checks that all properties marked as required have been assigned a value.

A protected $parametersRequired property must contain the names of the required parameters on the class that will use this trait method. and all parameters must each have a defined get accessor on the class object instance

Return Value

bool

Exceptions

MissingParameterException

protected array propertiesToArray()

This method picks up all the defined properties the $parameterRequired|$parameterOptional property array list from the class object and returns an array containing each list item name as a key and the matching property value from the class

Return Value

array An array of parameters with values

protected mixed accessPropertyByKey(string $key)

This method calls the accessors for keys passed in and returns back the value it receives from the class instance

throws an error if a defined parameter in the $parameterRequired|$parameterOptional does not have a reachable get[PropertyName] accessor defined on the class instance.

Parameters

string $key /$parameterRequired[()]|$parameterOptional[()]/

Return Value

mixed

Exceptions

BadMethodCallException