TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
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\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 Result\setErrorsExist().

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 Result\setNoticesExist().

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 Result\setWarningsExist().

clear ( )

Clears the result

Returns
void

Definition at line 311 of file Result.php.

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.

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 Result\recurseThroughResult().

getErrors ( )

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

Returns
array<>

Definition at line 144 of file Result.php.

References Result\$errors.

getFirstError ( )

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

Returns

Definition at line 177 of file Result.php.

getFirstNotice ( )

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

Returns

Definition at line 201 of file Result.php.

getFirstWarning ( )

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

Returns

Definition at line 189 of file Result.php.

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.

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.

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.

getNotices ( )

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

Returns
array<>

Definition at line 166 of file Result.php.

References Result\$notices.

getSubResults ( )

Get a list of all sub Result objects available.

Returns
[]

Definition at line 494 of file Result.php.

getWarnings ( )

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

Returns
array<>

Definition at line 155 of file Result.php.

References Result\$warnings.

hasErrors ( )

Does the current Result object have Errors? (Recursively)

Returns
bool

Definition at line 350 of file Result.php.

Referenced by Result\setParent().

hasMessages ( )

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

Returns
bool

Definition at line 301 of file Result.php.

References Result\$warningsExist.

hasNotices ( )

Does the current Result object have Notices? (Recursively)

Returns
bool

Definition at line 372 of file Result.php.

Referenced by Result\setParent().

hasProperty (   $propertyName,
  $checkerMethodName 
)
protected

Internal use only!

Parameters
string$propertyName
string$checkerMethodName
Returns
bool

Definition at line 331 of file Result.php.

hasWarnings ( )

Does the current Result object have Warnings? (Recursively)

Returns
bool

Definition at line 361 of file Result.php.

Referenced by Result\setParent().

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.

recurseThroughResult ( array  $pathSegments)

Internal use only!

Parameters
array$pathSegments
Returns

Definition at line 238 of file Result.php.

Referenced by Result\forProperty().

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 Result\addError(), and Result\setParent().

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 Result\addNotice(), and Result\setParent().

setParent ( Result  $parent)

Injects the parent result and propagates the cached error states upwards

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

Definition at line 83 of file Result.php.

References Result\$parent, Result\hasErrors(), Result\hasNotices(), Result\hasWarnings(), Result\setErrorsExist(), Result\setNoticesExist(), and Result\setWarningsExist().

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 Result\addWarning(), and Result\setParent().

Member Data Documentation

$errors = []
protected

Definition at line 34 of file Result.php.

Referenced by Result\getErrors().

$errorsExist = false
protected

Definition at line 40 of file Result.php.

$notices = []
protected

Definition at line 56 of file Result.php.

Referenced by Result\getNotices().

$noticesExist = false
protected

Definition at line 62 of file Result.php.

$parent = null
protected

Definition at line 74 of file Result.php.

Referenced by Result\setParent().

$propertyResults = []
protected

Definition at line 69 of file Result.php.

$warnings = []
protected

Definition at line 45 of file Result.php.

Referenced by Result\getWarnings().

$warningsExist = false
protected

Definition at line 51 of file Result.php.

Referenced by Result\hasMessages().