[TASK] Rename deprecation message version from 1.6 to 6.0
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Property / MappingResults.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
6 * All rights reserved
7 *
8 * This class is a backport of the corresponding class of FLOW3.
9 * All credits go to the v5 team.
10 *
11 * This script is part of the TYPO3 project. The TYPO3 project is
12 * free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * The GNU General Public License can be found at
18 * http://www.gnu.org/copyleft/gpl.html.
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27
28 /**
29 * The Mapping Results
30 *
31 * @package Extbase
32 * @subpackage Property
33 * @version $Id$
34 * @scope prototype
35 * @deprecated since Extbase 1.4.0, will be removed in Extbase 6.0
36 */
37 class Tx_Extbase_Property_MappingResults {
38
39 /**
40 * @var array An array of the occured errors
41 */
42 protected $errors = array();
43
44 /**
45 * @var array An array of the occured warnings
46 */
47 protected $warnings = array();
48
49 /**
50 * Adds an error to the mapping results. This might be for example a
51 * validation or mapping error
52 *
53 * @param Tx_Extbase_Error_Error $error The occured error
54 * @param string $propertyName The name of the property which caused the error
55 */
56 public function addError(Tx_Extbase_Error_Error $error, $propertyName) {
57 $this->errors[$propertyName] = $error;
58 }
59
60 /**
61 * Returns all errors that occured so far
62 *
63 * @return array Array of Tx_Extbase_Error_Error
64 */
65 public function getErrors() {
66 return $this->errors;
67 }
68
69 /**
70 * Returns true if any error was recognized
71 *
72 * @return boolean True if an error occured
73 */
74 public function hasErrors() {
75 return (count($this->errors) > 0);
76 }
77
78 /**
79 * Adds a warning to the mapping results. This might be for example a
80 * property that could not be mapped but wasn't marked as required.
81 *
82 * @param string $warning The occured warning
83 * @param string $propertyName The name of the property which caused the error
84 */
85 public function addWarning($warning, $propertyName) {
86 $this->warnings[$propertyName] = $warning;
87 }
88
89 /**
90 * Returns all warnings that occured so far
91 *
92 * @return array Array of warnings
93 */
94 public function getWarnings() {
95 return $this->warnings;
96 }
97
98 /**
99 * Returns TRUE if any warning was recognized
100 *
101 * @return boolean TRUE if a warning occured
102 */
103 public function hasWarnings() {
104 return (count($this->warnings) > 0);
105 }
106 }
107
108 ?>