84 if ($this->parent !== $parent) {
106 $this->errors[] = $error;
118 $this->warnings[] = $warning;
130 $this->notices[] = $notice;
171 reset($this->errors);
172 return current($this->errors);
182 reset($this->warnings);
183 return current($this->warnings);
193 reset($this->notices);
194 return current($this->notices);
208 if ($propertyPath ===
'' || $propertyPath === NULL) {
211 if (strpos($propertyPath,
'.') !== FALSE) {
214 if (!isset($this->propertyResults[$propertyPath])) {
215 $this->propertyResults[$propertyPath] =
new Result();
216 $this->propertyResults[$propertyPath]->setParent($this);
218 return $this->propertyResults[$propertyPath];
228 if (count($pathSegments) === 0) {
232 $propertyName = array_shift($pathSegments);
234 if (!isset($this->propertyResults[$propertyName])) {
235 $this->propertyResults[$propertyName] =
new Result();
236 $this->propertyResults[$propertyName]->setParent($this);
239 return $this->propertyResults[$propertyName]->recurseThroughResult($pathSegments);
249 $this->errorsExist = TRUE;
250 if ($this->parent !== NULL) {
251 $this->parent->setErrorsExist();
262 $this->warningsExist = TRUE;
263 if ($this->parent !== NULL) {
264 $this->parent->setWarningsExist();
275 $this->noticesExist = TRUE;
276 if ($this->parent !== NULL) {
277 $this->parent->setNoticesExist();
296 $this->errors = array();
297 $this->notices = array();
298 $this->warnings = array();
300 $this->warningsExist = FALSE;
301 $this->noticesExist = FALSE;
302 $this->errorsExist = FALSE;
304 $this->propertyResults = array();
314 protected function hasProperty($propertyName, $checkerMethodName) {
315 if (count($this->{$propertyName}) > 0) {
318 foreach ($this->propertyResults as $subResult) {
319 if ($subResult->{$checkerMethodName}()) {
343 return $this->
hasProperty(
'warnings',
'hasWarnings');
353 return $this->
hasProperty(
'notices',
'hasNotices');
409 if (count($this->$propertyName) > 0) {
410 $result[implode(
'.', $level)] = $this->$propertyName;
412 foreach ($this->propertyResults as $subPropertyName => $subResult) {
413 array_push($level, $subPropertyName);
414 $subResult->flattenTree($propertyName,
$result, $level);
426 public function merge(
Result $otherResult) {
427 if ($otherResult->errorsExist) {
430 if ($otherResult->warningsExist) {
431 $this->
mergeProperty($otherResult,
'getWarnings',
'addWarning');
433 if ($otherResult->noticesExist) {
434 $this->
mergeProperty($otherResult,
'getNotices',
'addNotice');
437 foreach ($otherResult->
getSubResults() as $subPropertyName => $subResult) {
439 if (array_key_exists($subPropertyName, $this->propertyResults) && $this->propertyResults[$subPropertyName]->hasMessages()) {
440 $this->
forProperty($subPropertyName)->merge($subResult);
442 $this->propertyResults[$subPropertyName] = $subResult;
443 $subResult->setParent($this);
457 foreach ($otherResult->$getterName() as $messageInOtherResult) {
458 $this->$adderName($messageInOtherResult);
hasProperty($propertyName, $checkerMethodName)
flattenTree($propertyName, &$result, $level)
mergeProperty(Result $otherResult, $getterName, $adderName)
forProperty($propertyPath)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
addWarning(\TYPO3\CMS\Extbase\Error\Warning $warning)
setParent(Result $parent)
recurseThroughResult(array $pathSegments)
addNotice(\TYPO3\CMS\Extbase\Error\Notice $notice)
addError(\TYPO3\CMS\Extbase\Error\Error $error)