[CLEANUP] Replace wrong/old file copyright comments
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Persistence / Generic / BackendInterface.php
1 <?php
2 namespace TYPO3\CMS\Extbase\Persistence\Generic;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2010-2012 Extbase Team (http://forge.typo3.org/projects/typo3v4-mvc)
8 * Extbase is a backport of TYPO3 Flow. All credits go to the TYPO3 Flow team.
9 * All rights reserved
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 * A copy is found in the textfile GPL.txt and important notices to the license
20 * from the author is found in LICENSE.txt distributed with these scripts.
21 *
22 *
23 * This script is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
27 *
28 * This copyright notice MUST APPEAR in all copies of the script!
29 ***************************************************************/
30 /**
31 * A persistence backend interface
32 */
33 interface BackendInterface {
34
35 /**
36 * Sets the aggregate root objects
37 *
38 * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $objects
39 * @return void
40 */
41 public function setAggregateRootObjects(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $objects);
42
43 /**
44 * Sets the deleted objects
45 *
46 * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $objects
47 * @return void
48 */
49 public function setDeletedObjects(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $objects);
50
51 /**
52 * Commits the current persistence session
53 *
54 * @return void
55 */
56 public function commit();
57
58 /**
59 * Returns the (internal) identifier for the object, if it is known to the
60 * backend. Otherwise NULL is returned.
61 *
62 * @param object $object
63 * @return string The identifier for the object if it is known, or NULL
64 */
65 public function getIdentifierByObject($object);
66
67 /**
68 * Returns the object with the (internal) identifier, if it is known to the
69 * backend. Otherwise NULL is returned.
70 *
71 * @param string $identifier
72 * @param string $className
73 * @return object The object for the identifier if it is known, or NULL
74 */
75 public function getObjectByIdentifier($identifier, $className);
76
77 /**
78 * Checks if the given object has ever been persisted.
79 *
80 * @param object $object The object to check
81 * @return boolean TRUE if the object is new, FALSE if the object exists in the repository
82 */
83 public function isNewObject($object);
84
85 /**
86 * Replaces the given object by the second object.
87 *
88 * This method will unregister the existing object at the identity map and
89 * register the new object instead. The existing object must therefore
90 * already be registered at the identity map which is the case for all
91 * reconstituted objects.
92 *
93 * The new object will be identified by the uuid which formerly belonged
94 * to the existing object. The existing object looses its uuid.
95 *
96 * @param object $existingObject The existing object
97 * @param object $newObject The new object
98 * @return void
99 */
100 public function replaceObject($existingObject, $newObject);
101 }
102
103 ?>