TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Extbase\Error\Result Class Reference

Public Member Functions

 setParent (Result $parent)
 
 addError (\TYPO3\CMS\Extbase\Error\Error $error)
 
 addWarning (\TYPO3\CMS\Extbase\Error\Warning $warning)
 
 addNotice (\TYPO3\CMS\Extbase\Error\Notice $notice)
 
 getErrors ()
 
 getWarnings ()
 
 getNotices ()
 
 getFirstError ()
 
 getFirstWarning ()
 
 getFirstNotice ()
 
 forProperty ($propertyPath)
 
 recurseThroughResult (array $pathSegments)
 
 hasMessages ()
 
 clear ()
 
 hasErrors ()
 
 hasWarnings ()
 
 hasNotices ()
 
 getFlattenedErrors ()
 
 getFlattenedWarnings ()
 
 getFlattenedNotices ()
 
 flattenTree ($propertyName, &$result, $level)
 
 getSubResults ()
 

Protected Member Functions

 setErrorsExist ()
 
 setWarningsExist ()
 
 setNoticesExist ()
 
 hasProperty ($propertyName, $checkerMethodName)
 
 mergeProperty (Result $otherResult, $getterName, $adderName)
 

Protected Attributes

 $errors = []
 
 $errorsExist = false
 
 $warnings = []
 
 $warningsExist = false
 
 $notices = []
 
 $noticesExist = false
 
 $propertyResults = []
 
 $parent = null
 

Detailed Description

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

http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later

Definition at line 29 of file Result.php.

Member Function Documentation

◆ addError()

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

Add an error to the current Result object

Parameters
\TYPO3\CMS\Extbase\Error\Error$error
Returns
void

Definition at line 106 of file Result.php.

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

◆ addNotice()

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

Add a notice to the current Result object

Parameters
\TYPO3\CMS\Extbase\Error\Notice$notice
Returns
void

Definition at line 132 of file Result.php.

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

◆ addWarning()

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

Add a warning to the current Result object

Parameters
\TYPO3\CMS\Extbase\Error\Warning$warning
Returns
void

Definition at line 119 of file Result.php.

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

◆ clear()

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

Clears the result

Returns
void

Definition at line 311 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
Returns
void

Definition at line 432 of file Result.php.

References TYPO3\CMS\Extbase\Error\Result\forProperty(), TYPO3\CMS\Extbase\Error\Result\getSubResults(), and TYPO3\CMS\Extbase\Error\Result\mergeProperty().

Referenced by TYPO3\CMS\Extbase\Error\Result\getFlattenedErrors(), TYPO3\CMS\Extbase\Error\Result\getFlattenedNotices(), and TYPO3\CMS\Extbase\Error\Result\getFlattenedWarnings().

◆ forProperty()

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

Definition at line 217 of file Result.php.

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

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

◆ getErrors()

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

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

Returns
array<>

Definition at line 144 of file Result.php.

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

◆ getFirstError()

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

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

Returns

Definition at line 177 of file Result.php.

◆ getFirstNotice()

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

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

Returns

Definition at line 201 of file Result.php.

◆ getFirstWarning()

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

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

Returns

Definition at line 189 of file Result.php.

◆ getFlattenedErrors()

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<>

Definition at line 385 of file Result.php.

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

◆ getFlattenedNotices()

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<>

Definition at line 415 of file Result.php.

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

◆ getFlattenedWarnings()

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<>

Definition at line 400 of file Result.php.

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

◆ getNotices()

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

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

Returns
array<>

Definition at line 166 of file Result.php.

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

◆ getSubResults()

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

Get a list of all sub Result objects available.

Returns
[]

Definition at line 494 of file Result.php.

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

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

◆ getWarnings()

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

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

Returns
array<>

Definition at line 155 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)

Returns
bool

Definition at line 350 of file Result.php.

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

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)

Returns
bool

Definition at line 301 of file Result.php.

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

◆ hasNotices()

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

Does the current Result object have Notices? (Recursively)

Returns
bool

Definition at line 372 of file Result.php.

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

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

◆ hasProperty()

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

Internal use only!

Parameters
string$propertyName
string$checkerMethodName
Returns
bool

Definition at line 331 of file Result.php.

Referenced by TYPO3\CMS\Extbase\Error\Result\hasErrors(), TYPO3\CMS\Extbase\Error\Result\hasNotices(), and TYPO3\CMS\Extbase\Error\Result\hasWarnings().

◆ hasWarnings()

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

Does the current Result object have Warnings? (Recursively)

Returns
bool

Definition at line 361 of file Result.php.

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

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

◆ mergeProperty()

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

Merge a single property from the other result object.

Parameters
\TYPO3\CMS\Extbase\Error\Result$otherResult
string$getterName
string$adderName
Returns
void

Definition at line 482 of file Result.php.

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

◆ recurseThroughResult()

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

Internal use only!

Parameters
array$pathSegments
Returns

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

Returns
void

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

Returns
void

Definition at line 288 of file Result.php.

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

◆ setParent()

TYPO3\CMS\Extbase\Error\Result::setParent ( Result  $parent)

◆ setWarningsExist()

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

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

Returns
void

Definition at line 274 of file Result.php.

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

Member Data Documentation

◆ $errors

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

Definition at line 34 of file Result.php.

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

◆ $errorsExist

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

Definition at line 40 of file Result.php.

◆ $notices

TYPO3\CMS\Extbase\Error\Result::$notices = []
protected

Definition at line 56 of file Result.php.

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

◆ $noticesExist

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

Definition at line 62 of file Result.php.

◆ $parent

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

Definition at line 74 of file Result.php.

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

◆ $propertyResults

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

Definition at line 69 of file Result.php.

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

◆ $warnings

TYPO3\CMS\Extbase\Error\Result::$warnings = []
protected

Definition at line 45 of file Result.php.

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

◆ $warningsExist

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

Definition at line 51 of file Result.php.

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