‪TYPO3CMS  9.5
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 ()
 
Error getFirstError ()
 
Warning getFirstWarning ()
 
Notice getFirstNotice ()
 
Result forProperty ($propertyPath)
 
Result recurseThroughResult (array $pathSegments)
 
bool hasMessages ()
 
 clear ()
 
bool hasErrors ()
 
bool hasWarnings ()
 
bool hasNotices ()
 
Error[] getFlattenedErrors ()
 
Warning[] getFlattenedWarnings ()
 
Notice[] getFlattenedNotices ()
 
 flattenTree ($propertyName, &$result, $level)
 
 merge (Result $otherResult)
 
Result[] getSubResults ()
 

Protected Member Functions

 setErrorsExist ()
 
 setWarningsExist ()
 
 setNoticesExist ()
 
bool hasProperty ($propertyName, $checkerMethodName)
 
 mergeProperty (Result $otherResult, $getterName, $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 19 of file Result.php.

Member Function Documentation

◆ addError()

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

Add an error to the current Result object

Parameters
Error$error

Definition at line 85 of file Result.php.

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

◆ addNotice()

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

Add a notice to the current Result object

Parameters
Notice$notice

Definition at line 107 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

Parameters
Warning$warning

Definition at line 96 of file Result.php.

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

◆ clear()

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

Clears the result

Definition at line 271 of file Result.php.

◆ flattenTree()

TYPO3\CMS\Extbase\Error\Result::flattenTree (   $propertyName,
$result,
  $level 
)

Only use internally!

Flatten a tree of Result objects, based on a certain property.

Parameters
string$propertyName
array$result
array$level

Definition at line 385 of file Result.php.

◆ forProperty()

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

Return a Result object for the given property path. This is a fluent interface, so you will proboably use it like: $result->forProperty('foo.bar')->getErrors() – to get all errors for property "foo.bar"

Parameters
string$propertyPath
Returns
Result

Definition at line 185 of file Result.php.

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

◆ getErrors()

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

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

Returns
Error[]

Definition at line 118 of file Result.php.

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

◆ getFirstError()

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

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

Returns
Error

Definition at line 148 of file Result.php.

◆ getFirstNotice()

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

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

Returns
Notice

Definition at line 170 of file Result.php.

◆ getFirstWarning()

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

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

Returns
Warning

Definition at line 159 of file Result.php.

◆ getFlattenedErrors()

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
Error[]

Definition at line 341 of file Result.php.

◆ getFlattenedNotices()

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
Notice[]

Definition at line 369 of file Result.php.

◆ getFlattenedWarnings()

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
Warning[]

Definition at line 355 of file Result.php.

◆ getNotices()

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

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

Returns
Notice[]

Definition at line 138 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 444 of file Result.php.

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 128 of file Result.php.

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

◆ hasErrors()

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

Does the current Result object have Errors? (Recursively)

Returns
‪bool

Definition at line 309 of file Result.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\Argument\isValid(), and TYPO3\CMS\Extbase\Error\Result\setParent().

◆ hasMessages()

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

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

Returns
‪bool

Definition at line 263 of file Result.php.

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

◆ hasNotices()

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

Does the current Result object have Notices? (Recursively)

Returns
‪bool

Definition at line 329 of file Result.php.

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

◆ hasProperty()

bool TYPO3\CMS\Extbase\Error\Result::hasProperty (   $propertyName,
  $checkerMethodName 
)
protected

Internal use only!

Parameters
string$propertyName
string$checkerMethodName
Returns
‪bool

Definition at line 291 of file Result.php.

◆ hasWarnings()

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

Does the current Result object have Warnings? (Recursively)

Returns
‪bool

Definition at line 319 of file Result.php.

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

◆ merge()

TYPO3\CMS\Extbase\Error\Result::merge ( Result  $otherResult)

Merge the given Result object into this one.

Parameters
Result$otherResult

Definition at line 402 of file Result.php.

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

Referenced by TYPO3\CMS\Extbase\Mvc\Controller\Argument\validate().

◆ mergeProperty()

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

Merge a single property from the other result object.

Parameters
Result$otherResult
string$getterName
string$adderName

Definition at line 432 of file Result.php.

◆ recurseThroughResult()

Result TYPO3\CMS\Extbase\Error\Result::recurseThroughResult ( array  $pathSegments)

Internal use only!

Parameters
array$pathSegments
Returns
Result

Definition at line 206 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 226 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 250 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 238 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

Definition at line 23 of file Result.php.

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

◆ $errorsExist

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

Caches the existence of errors

Definition at line 28 of file Result.php.

◆ $notices

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

Definition at line 41 of file Result.php.

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

◆ $noticesExist

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

Caches the existence of notices

Definition at line 46 of file Result.php.

◆ $parent

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

Definition at line 56 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 52 of file Result.php.

◆ $warnings

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

Definition at line 32 of file Result.php.

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

◆ $warningsExist

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

Caches the existence of warning

Definition at line 37 of file Result.php.

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