2 /***************************************************************
5 * (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
8 * This class is a backport of the corresponding class of FLOW3.
9 * All credits go to the v5 team.
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.
17 * The GNU General Public License can be found at
18 * http://www.gnu.org/copyleft/gpl.html.
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.
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
29 * A persistence backend interface
32 * @subpackage Persistence
33 * @version $Id: BackendInterface.php 2087 2009-03-26 16:46:14Z sebastian $
35 interface Tx_Extbase_Persistence_BackendInterface
{
38 * Sets the aggregate root objects
40 * @param Tx_Extbase_Persistence_ObjectStorage $objects
43 public function setAggregateRootObjects(Tx_Extbase_Persistence_ObjectStorage
$objects);
46 * Sets the deleted objects
48 * @param Tx_Extbase_Persistence_ObjectStorage $objects
51 public function setDeletedObjects(Tx_Extbase_Persistence_ObjectStorage
$objects);
54 * Commits the current persistence session
58 public function commit();
61 * Returns the (internal) identifier for the object, if it is known to the
62 * backend. Otherwise NULL is returned.
64 * @param object $object
65 * @return string The identifier for the object if it is known, or NULL
67 public function getIdentifierByObject($object);
70 * Checks if the given object has ever been persisted.
72 * @param object $object The object to check
73 * @return boolean TRUE if the object is new, FALSE if the object exists in the repository
75 public function isNewObject($object);
78 * Replaces the given object by the second object.
80 * This method will unregister the existing object at the identity map and
81 * register the new object instead. The existing object must therefore
82 * already be registered at the identity map which is the case for all
83 * reconstituted objects.
85 * The new object will be identified by the uuid which formerly belonged
86 * to the existing object. The existing object looses its uuid.
88 * @param object $existingObject The existing object
89 * @param object $newObject The new object
92 public function replaceObject($existingObject, $newObject);