Extbase:
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / DomainObject / DomainObjectInterface.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 *
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
24
25 /**
26 * A Domain Object Interface. All domain objects which should be persisted need to implement the below interface.
27 * Usually you will need to subclass Tx_Extbase_DomainObject_AbstractEntity and Tx_Extbase_DomainObject_AbstractValueObject
28 * instead.
29 *
30 * @see Tx_Extbase_DomainObject_AbstractEntity
31 * @see Tx_Extbase_DomainObject_AbstractValueObject
32 *
33 * @package Extbase
34 * @subpackage DomainObject
35 * @version $ID:$
36 */
37 interface Tx_Extbase_DomainObject_DomainObjectInterface {
38
39 /**
40 * Register an object's clean state, e.g. after it has been reconstituted
41 * from the database
42 *
43 * @return void
44 * @internal
45 */
46 public function _memorizeCleanState();
47
48 /**
49 * Returns TRUE if the object is new (the uid was not set, yet). Only for internal use
50 *
51 * @return boolean
52 * @internal
53 */
54 public function _isNew();
55
56 /**
57 * Returns TRUE if the properties were modified after reconstitution
58 *
59 * @return boolean
60 * @internal
61 */
62 public function _isDirty();
63
64 /**
65 * Reconstitutes a property. Only for internal use.
66 *
67 * @param string $propertyName
68 * @param string $value
69 * @return void
70 * @internal
71 */
72 public function _setProperty($propertyName, $value);
73
74 /**
75 * Returns the property value of the given property name. Only for internal use.
76 *
77 * @return mixed The propertyValue
78 * @internal
79 */
80 public function _getProperty($propertyName);
81
82 /**
83 * Returns a hash map of property names and property values
84 *
85 * @return array The properties
86 * @internal
87 */
88 public function _getProperties();
89
90 /**
91 * Returns a hash map of dirty properties and $values
92 *
93 * @return boolean
94 * @internal
95 */
96 public function _getDirtyProperties();
97
98 }
99 ?>