Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Structures de données | |
interface | ResultAwareInterface |
Fonctions | |
addResult ($data) | |
setResult (array $value) | |
typeCheckResult ($data) | |
Variables | |
trait | ResultAware |
trait | ResultTypeArrayAware |
$resultIsFalseable = false | |
trait | ResultTypeBooleanAware |
trait | ResultTypeFloatAware |
trait | ResultTypeIntegerAware |
trait | ResultTypeNumericAware |
trait | ResultTypeObjectAware |
$resultAcceptableClasses = [] | |
trait | ResultTypeStringAware |
Joomla! Content Management System
Joomla\CMS\Event\Result\addResult | ( | $data | ) |
Appends data to the result array of the event.
mixed | $data | What to add to the result array. |
Références $data, $this, class, et Joomla\CMS\Event\Result\typeCheckResult().
Référencé par Joomla\CMS\Event\Result\setResult().
|
protected |
Handle setting the result argument directly.
This method serves a dual purpose: backwards compatibility and enforcing the use of addResult.
When $this->preventSetArgumentResult is false it acts as a backwards compatibility shim for event handlers expecting generic event classes instead of the concrete Events implemented in this package. This allows the migration to concrete event classes throughout the lifetime of Joomla 4.x.
When $this->preventSetArgumentResult is false (which will always be the case on Joomla 5.0) it will throw a BadMethodCallException if the developer tries to call setArgument('result', ...) instead of going through the addResult() method.
array | $value | The new result array. |
Références $value, et Joomla\CMS\Event\Result\addResult().
typeCheckResult | ( | $data | ) |
Checks the type of the data being appended to the result argument.
mixed | $data | The data to type check |
InvalidArgumentException |
Référencé par Joomla\CMS\Event\Result\addResult().
|
protected |
|
protected |
trait ResultAware |
This Trait partially implements the ResultAwareInterface for mutable and immutable events.
You must additionally implement the typeCheckResult method or use one of the ResultType*Aware traits in your Event handler.
trait ResultTypeArrayAware |
This Trait partially implements the ResultAwareInterface for type checking.
Events using this Trait (and the ResultAware trait) will expect event handlers to set results of an Array type.
trait ResultTypeBooleanAware |
This Trait partially implements the ResultAwareInterface for type checking.
Events using this Trait (and the ResultAware trait) will expect event handlers to set results of a Boolean type.
trait ResultTypeFloatAware |
This Trait partially implements the ResultAwareInterface for type checking.
Events using this Trait (and the ResultAware trait) will expect event handlers to set results of a Float type.
trait ResultTypeIntegerAware |
This Trait partially implements the ResultAwareInterface for type checking.
Events using this Trait (and the ResultAware trait) will expect event handlers to set results of an Integer type.
trait ResultTypeNumericAware |
This Trait partially implements the ResultAwareInterface for type checking.
Events using this Trait (and the ResultAware trait) will expect event handlers to set results of a Numeric type.
trait ResultTypeObjectAware |
This Trait partially implements the ResultAwareInterface for type checking.
Events using this Trait (and the ResultAware trait) will expect event handlers to set results of an object type.
If you do not set a list of acceptable result classes any PHP object will satisfy this type check.
trait ResultTypeStringAware |
This Trait partially implements the ResultAwareInterface for type checking.
Events using this Trait (and the ResultAware trait) will expect event handlers to set results of a String type.