Splitted logic between entities and ValueObjects
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / DomainObject / AbstractValueObject.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 abstract Value Object. A Value Object is an object that describes some characteristic
27 * or attribute (e.g. a color) but carries no concept of identity.
28 *
29 * @package TYPO3
30 * @subpackage extbase
31 * @version $ID:$
32 */
33 abstract class Tx_ExtBase_DomainObject_AbstractValueObject extends Tx_ExtBase_DomainObject_AbstractDomainObject {
34
35 /**
36 * Register an object's clean state, e.g. after it has been reconstituted
37 * from the database
38 *
39 * @return void
40 * @internal
41 */
42 public function _memorizeCleanState() {
43 }
44
45 /**
46 * Returns a hash map of dirty properties and $values. This is always the empty array for ValueObjects, because ValueObjects never change.
47 *
48 * @return array
49 * @internal
50 */
51 public function _getDirtyProperties() {
52 return array();
53 }
54
55 /**
56 * Returns TRUE if the properties were modified after reconstitution. However, value objects can be never updated.
57 *
58 * @return boolean
59 * @internal
60 */
61 public function _isDirty() {
62 return FALSE;
63 }
64 }
65 ?>