‪TYPO3CMS  ‪main
TYPO3\CMS\Extbase\Error\Result Class Reference

Public Member Functions

 setParent (Result $parent)
 
 addError (Error $error)
 
 addWarning (Warning $warning)
 
 addNotice (Notice $notice)
 
Error[] getErrors ()
 
Warning[] getWarnings ()
 
Notice[] getNotices ()
 
bool Error getFirstError ()
 
bool Warning getFirstWarning ()
 
bool Notice getFirstNotice ()
 
 forProperty (?string $propertyPath)
 
 recurseThroughResult (array $pathSegments)
 
 hasMessages ()
 
 clear ()
 
 hasErrors ()
 
 hasWarnings ()
 
 hasNotices ()
 
array< string, array< Error > > getFlattenedErrors ()
 
array< string, array< Warning > > getFlattenedWarnings ()
 
array< string, array< Notice > > getFlattenedNotices ()
 
 merge (Result $otherResult)
 
Result[] getSubResults ()
 

Protected Member Functions

 setErrorsExist ()
 
 setWarningsExist ()
 
 setNoticesExist ()
 
 flattenErrorTree (array &$result, array $level)
 
 flattenWarningsTree (array &$result, array $level)
 
 flattenNoticesTree (array &$result, array $level)
 
 mergeProperty (Result $otherResult, string $getterName, string $adderName)
 

Protected Attributes

Error[] $errors = array( )
 
bool $errorsExist = false
 
Warning[] $warnings = array( )
 
bool $warningsExist = false
 
Notice[] $notices = array( )
 
bool $noticesExist = false
 
Result[] $propertyResults = array( )
 
Result $parent
 

Detailed Description

Result object for operations dealing with objects, such as the Property Mapper or the Validators.

Definition at line 23 of file Result.php.

Member Function Documentation

◆ addError()

TYPO3\CMS\Extbase\Error\Result::addError ( Error  $error)

◆ addNotice()

TYPO3\CMS\Extbase\Error\Result::addNotice ( Notice  $notice)

Add a notice to the current Result object

Definition at line 103 of file Result.php.

References TYPO3\CMS\Extbase\Error\Result\setNoticesExist().

◆ addWarning()

TYPO3\CMS\Extbase\Error\Result::addWarning ( Warning  $warning)

Add a warning to the current Result object

Definition at line 94 of file Result.php.

References TYPO3\CMS\Extbase\Error\Result\setWarningsExist().

◆ clear()

TYPO3\CMS\Extbase\Error\Result::clear ( )

Clears the result

Definition at line 261 of file Result.php.

◆ flattenErrorTree()

TYPO3\CMS\Extbase\Error\Result::flattenErrorTree ( array &  $result,
array  $level 
)
protected

◆ flattenNoticesTree()

TYPO3\CMS\Extbase\Error\Result::flattenNoticesTree ( array &  $result,
array  $level 
)
protected

◆ flattenWarningsTree()

TYPO3\CMS\Extbase\Error\Result::flattenWarningsTree ( array &  $result,
array  $level 
)
protected

◆ forProperty()

TYPO3\CMS\Extbase\Error\Result::forProperty ( ?string  $propertyPath)

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"

Definition at line 178 of file Result.php.

References TYPO3\CMS\Extbase\Error\Result\recurseThroughResult().

Referenced by TYPO3\CMS\Extbase\Error\Result\merge().

◆ getErrors()

Error [] TYPO3\CMS\Extbase\Error\Result::getErrors ( )

Get all errors in the current Result object (non-recursive)

Returns
Error[]

Definition at line 114 of file Result.php.

References TYPO3\CMS\Extbase\Error\Result\$errors.

◆ getFirstError()

bool Error TYPO3\CMS\Extbase\Error\Result::getFirstError ( )

Get the first error object of the current Result object (non-recursive)

Returns
‪bool|Error

Definition at line 144 of file Result.php.

◆ getFirstNotice()

bool Notice TYPO3\CMS\Extbase\Error\Result::getFirstNotice ( )

Get the first notice object of the current Result object (non-recursive)

Returns
‪bool|Notice

Definition at line 166 of file Result.php.

◆ getFirstWarning()

bool Warning TYPO3\CMS\Extbase\Error\Result::getFirstWarning ( )

Get the first warning object of the current Result object (non-recursive)

Returns
‪bool|Warning

Definition at line 155 of file Result.php.

◆ getFlattenedErrors()

array<string,array<Error> > TYPO3\CMS\Extbase\Error\Result::getFlattenedErrors ( )

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)

Returns
‪array<string,array<Error>>

Definition at line 335 of file Result.php.

References TYPO3\CMS\Extbase\Error\Result\flattenErrorTree().

◆ getFlattenedNotices()

array<string,array<Notice> > TYPO3\CMS\Extbase\Error\Result::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)

Returns
‪array<string,array<Notice>>

Definition at line 363 of file Result.php.

References TYPO3\CMS\Extbase\Error\Result\flattenNoticesTree().

◆ getFlattenedWarnings()

array<string,array<Warning> > TYPO3\CMS\Extbase\Error\Result::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)

Returns
‪array<string,array<Warning>>

Definition at line 349 of file Result.php.

References TYPO3\CMS\Extbase\Error\Result\flattenWarningsTree().

◆ getNotices()

Notice [] TYPO3\CMS\Extbase\Error\Result::getNotices ( )

Get all notices in the current Result object (non-recursive)

Returns
Notice[]

Definition at line 134 of file Result.php.

References TYPO3\CMS\Extbase\Error\Result\$notices.

◆ getSubResults()

Result [] TYPO3\CMS\Extbase\Error\Result::getSubResults ( )

Get a list of all sub Result objects available.

Returns
Result[]

Definition at line 454 of file Result.php.

References TYPO3\CMS\Extbase\Error\Result\$propertyResults.

Referenced by TYPO3\CMS\Extbase\Error\Result\merge().

◆ getWarnings()

Warning [] TYPO3\CMS\Extbase\Error\Result::getWarnings ( )

Get all warnings in the current Result object (non-recursive)

Returns
Warning[]

Definition at line 124 of file Result.php.

References TYPO3\CMS\Extbase\Error\Result\$warnings.

◆ hasErrors()

TYPO3\CMS\Extbase\Error\Result::hasErrors ( )

Does the current Result object have Errors? (Recursively)

Definition at line 277 of file Result.php.

Referenced by TYPO3\CMS\Extbase\Error\Result\setParent().

◆ hasMessages()

TYPO3\CMS\Extbase\Error\Result::hasMessages ( )

Does the current Result object have Notices, Errors or Warnings? (Recursively)

Definition at line 253 of file Result.php.

References TYPO3\CMS\Extbase\Error\Result\$warningsExist.

Referenced by TYPO3\CMS\Extbase\Error\Result\merge().

◆ hasNotices()

TYPO3\CMS\Extbase\Error\Result::hasNotices ( )

Does the current Result object have Notices? (Recursively)

Definition at line 313 of file Result.php.

Referenced by TYPO3\CMS\Extbase\Error\Result\setParent().

◆ hasWarnings()

TYPO3\CMS\Extbase\Error\Result::hasWarnings ( )

Does the current Result object have Warnings? (Recursively)

Definition at line 295 of file Result.php.

Referenced by TYPO3\CMS\Extbase\Error\Result\setParent().

◆ merge()

◆ mergeProperty()

TYPO3\CMS\Extbase\Error\Result::mergeProperty ( Result  $otherResult,
string  $getterName,
string  $adderName 
)
protected

Merge a single property from the other result object.

Definition at line 435 of file Result.php.

Referenced by TYPO3\CMS\Extbase\Error\Result\merge().

◆ recurseThroughResult()

TYPO3\CMS\Extbase\Error\Result::recurseThroughResult ( array  $pathSegments)
Todo:
‪: consider making this method protected as it will and should not be called from an outside scope

only to be used within Extbase, not part of TYPO3 Core API.

Definition at line 198 of file Result.php.

Referenced by TYPO3\CMS\Extbase\Error\Result\forProperty().

◆ setErrorsExist()

TYPO3\CMS\Extbase\Error\Result::setErrorsExist ( )
protected

Sets the error cache to TRUE and propagates the information upwards the Result-Object Tree

Definition at line 218 of file Result.php.

Referenced by TYPO3\CMS\Extbase\Error\Result\addError(), and TYPO3\CMS\Extbase\Error\Result\setParent().

◆ setNoticesExist()

TYPO3\CMS\Extbase\Error\Result::setNoticesExist ( )
protected

Sets the notices cache to TRUE and propagates the information upwards the Result-Object Tree

Definition at line 242 of file Result.php.

Referenced by TYPO3\CMS\Extbase\Error\Result\addNotice(), and TYPO3\CMS\Extbase\Error\Result\setParent().

◆ setParent()

◆ setWarningsExist()

TYPO3\CMS\Extbase\Error\Result::setWarningsExist ( )
protected

Sets the warning cache to TRUE and propagates the information upwards the Result-Object Tree

Definition at line 230 of file Result.php.

Referenced by TYPO3\CMS\Extbase\Error\Result\addWarning(), and TYPO3\CMS\Extbase\Error\Result\setParent().

Member Data Documentation

◆ $errors

Error [] TYPO3\CMS\Extbase\Error\Result::$errors = array( )
protected

◆ $errorsExist

bool TYPO3\CMS\Extbase\Error\Result::$errorsExist = false
protected

Caches the existence of errors

Definition at line 32 of file Result.php.

◆ $notices

Notice [] TYPO3\CMS\Extbase\Error\Result::$notices = array( )
protected

◆ $noticesExist

bool TYPO3\CMS\Extbase\Error\Result::$noticesExist = false
protected

Caches the existence of notices

Definition at line 50 of file Result.php.

◆ $parent

Result TYPO3\CMS\Extbase\Error\Result::$parent
protected

Definition at line 60 of file Result.php.

Referenced by TYPO3\CMS\Extbase\Error\Result\setParent().

◆ $propertyResults

Result [] TYPO3\CMS\Extbase\Error\Result::$propertyResults = array( )
protected

The result objects for the sub properties

Definition at line 56 of file Result.php.

Referenced by TYPO3\CMS\Extbase\Error\Result\getSubResults().

◆ $warnings

Warning [] TYPO3\CMS\Extbase\Error\Result::$warnings = array( )
protected

◆ $warningsExist

bool TYPO3\CMS\Extbase\Error\Result::$warningsExist = false
protected

Caches the existence of warning

Definition at line 41 of file Result.php.

Referenced by TYPO3\CMS\Extbase\Error\Result\hasMessages().