Result
class \
Result object for operations dealing with objects, such as the Property Mapper or the Validators.
Table of Contents
Properties
- $errors : Error[]
- $errorsExist : bool
- Caches the existence of errors
- $notices : Notice[]
- $noticesExist : bool
- Caches the existence of notices
- $parent : Result
- $propertyResults : Result[]
- The result objects for the sub properties
- $warnings : Warning[]
- $warningsExist : bool
- Caches the existence of warning
Methods
- addError() : void
- Add an error to the current Result object
- addNotice() : void
- Add a notice to the current Result object
- addWarning() : void
- Add a warning to the current Result object
- clear() : void
- Clears the result
- forProperty() : Result
- Return a Result object for the given property path. This is a fluent interface, so you will probably use it like: $result->forProperty('foo.bar')->getErrors() -- to get all errors for property "foo.bar"
- getErrors() : Error[]
- Get all errors in the current Result object (non-recursive)
- getFirstError() : bool|Error
- Get the first error object of the current Result object (non-recursive)
- getFirstNotice() : bool|Notice
- Get the first notice object of the current Result object (non-recursive)
- getFirstWarning() : bool|Warning
- Get the first warning object of the current Result object (non-recursive)
- getFlattenedErrors() : array<string, Error[]>
- Get a list of all Error objects recursively. The result is an array, where the key is the property path where the error occurred, and the value is a list of all errors (stored as array)
- getFlattenedNotices() : array<string, Notice[]>
- Get a list of all Notice objects recursively. The result is an array, where the key is the property path where the notice occurred, and the value is a list of all notices (stored as array)
- getFlattenedWarnings() : array<string, Warning[]>
- Get a list of all Warning objects recursively. The result is an array, where the key is the property path where the warning occurred, and the value is a list of all warnings (stored as array)
- getNotices() : Notice[]
- Get all notices in the current Result object (non-recursive)
- getSubResults() : Result[]
- Get a list of all sub Result objects available.
- getWarnings() : Warning[]
- Get all warnings in the current Result object (non-recursive)
- hasErrors() : bool
- Does the current Result object have Errors? (Recursively)
- hasMessages() : bool
- Does the current Result object have Notices, Errors or Warnings? (Recursively)
- hasNotices() : bool
- Does the current Result object have Notices? (Recursively)
- hasWarnings() : bool
- Does the current Result object have Warnings? (Recursively)
- merge() : void
- Merge the given Result object into this one.
- recurseThroughResult() : Result
- setParent() : void
- Injects the parent result and propagates the cached error states upwards
- flattenErrorTree() : void
- flattenNoticesTree() : void
- flattenWarningsTree() : void
- mergeProperty() : void
- Merge a single property from the other result object.
- setErrorsExist() : void
- Sets the error cache to TRUE and propagates the information upwards the Result-Object Tree
- setNoticesExist() : void
- Sets the notices cache to TRUE and propagates the information upwards the Result-Object Tree
- setWarningsExist() : void
- Sets the warning cache to TRUE and propagates the information upwards the Result-Object Tree
Properties
$errors
protected
Error[]
$errors
= []
$errorsExist
Caches the existence of errors
protected
bool
$errorsExist
= false
$notices
protected
Notice[]
$notices
= []
$noticesExist
Caches the existence of notices
protected
bool
$noticesExist
= false
$parent
protected
Result
$parent
$propertyResults
The result objects for the sub properties
protected
Result[]
$propertyResults
= []
$warnings
protected
Warning[]
$warnings
= []
$warningsExist
Caches the existence of warning
protected
bool
$warningsExist
= false
Methods
addError()
Add an error to the current Result object
public
addError(Error $error) : void
Parameters
- $error : Error
addNotice()
Add a notice to the current Result object
public
addNotice(Notice $notice) : void
Parameters
- $notice : Notice
addWarning()
Add a warning to the current Result object
public
addWarning(Warning $warning) : void
Parameters
- $warning : Warning
clear()
Clears the result
public
clear() : void
forProperty()
Return a Result object for the given property path. This is a fluent interface, so you will probably use it like: $result->forProperty('foo.bar')->getErrors() -- to get all errors for property "foo.bar"
public
forProperty(string|null $propertyPath) : Result
Parameters
- $propertyPath : string|null
Return values
ResultgetErrors()
Get all errors in the current Result object (non-recursive)
public
getErrors() : Error[]
Return values
Error[]getFirstError()
Get the first error object of the current Result object (non-recursive)
public
getFirstError() : bool|Error
Return values
bool|ErrorgetFirstNotice()
Get the first notice object of the current Result object (non-recursive)
public
getFirstNotice() : bool|Notice
Return values
bool|NoticegetFirstWarning()
Get the first warning object of the current Result object (non-recursive)
public
getFirstWarning() : bool|Warning
Return values
bool|WarninggetFlattenedErrors()
Get a list of all Error objects recursively. The result is an array, where the key is the property path where the error occurred, and the value is a list of all errors (stored as array)
public
getFlattenedErrors() : array<string, Error[]>
Return values
array<string, Error[]>getFlattenedNotices()
Get a list of all Notice objects recursively. The result is an array, where the key is the property path where the notice occurred, and the value is a list of all notices (stored as array)
public
getFlattenedNotices() : array<string, Notice[]>
Return values
array<string, Notice[]>getFlattenedWarnings()
Get a list of all Warning objects recursively. The result is an array, where the key is the property path where the warning occurred, and the value is a list of all warnings (stored as array)
public
getFlattenedWarnings() : array<string, Warning[]>
Return values
array<string, Warning[]>getNotices()
Get all notices in the current Result object (non-recursive)
public
getNotices() : Notice[]
Return values
Notice[]getSubResults()
Get a list of all sub Result objects available.
public
getSubResults() : Result[]
Return values
Result[]getWarnings()
Get all warnings in the current Result object (non-recursive)
public
getWarnings() : Warning[]
Return values
Warning[]hasErrors()
Does the current Result object have Errors? (Recursively)
public
hasErrors() : bool
Return values
boolhasMessages()
Does the current Result object have Notices, Errors or Warnings? (Recursively)
public
hasMessages() : bool
Return values
boolhasNotices()
Does the current Result object have Notices? (Recursively)
public
hasNotices() : bool
Return values
boolhasWarnings()
Does the current Result object have Warnings? (Recursively)
public
hasWarnings() : bool
Return values
boolmerge()
Merge the given Result object into this one.
public
merge(Result $otherResult) : void
Parameters
- $otherResult : Result
recurseThroughResult()
public
recurseThroughResult(array $pathSegments) : Result
Parameters
- $pathSegments : array
Internal
only to be used within Extbase, not part of TYPO3 Core API.
Tags
Return values
ResultsetParent()
Injects the parent result and propagates the cached error states upwards
public
setParent(Result $parent) : void
Parameters
- $parent : Result
flattenErrorTree()
protected
flattenErrorTree(array &$result, array $level) : void
Parameters
- $result : array
- $level : array
flattenNoticesTree()
protected
flattenNoticesTree(array &$result, array $level) : void
Parameters
- $result : array
- $level : array
flattenWarningsTree()
protected
flattenWarningsTree(array &$result, array $level) : void
Parameters
- $result : array
- $level : array
mergeProperty()
Merge a single property from the other result object.
protected
mergeProperty(Result $otherResult, string $getterName, string $adderName) : void
Parameters
- $otherResult : Result
- $getterName : string
- $adderName : string
setErrorsExist()
Sets the error cache to TRUE and propagates the information upwards the Result-Object Tree
protected
setErrorsExist() : void
setNoticesExist()
Sets the notices cache to TRUE and propagates the information upwards the Result-Object Tree
protected
setNoticesExist() : void
setWarningsExist()
Sets the warning cache to TRUE and propagates the information upwards the Result-Object Tree
protected
setWarningsExist() : void