TYPO3 API  SVNRelease
BackendInterface.php
Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
00006 *  All rights reserved
00007 *
00008 *  This class is a backport of the corresponding class of FLOW3.
00009 *  All credits go to the v5 team.
00010 *
00011 *  This script is part of the TYPO3 project. The TYPO3 project is
00012 *  free software; you can redistribute it and/or modify
00013 *  it under the terms of the GNU General Public License as published by
00014 *  the Free Software Foundation; either version 2 of the License, or
00015 *  (at your option) any later version.
00016 *
00017 *  The GNU General Public License can be found at
00018 *  http://www.gnu.org/copyleft/gpl.html.
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00027 
00028 /**
00029  * A persistence backend interface
00030  *
00031  * @package Extbase
00032  * @subpackage Persistence
00033  * @version $Id: BackendInterface.php 1729 2009-11-25 21:37:20Z stucki $
00034  */
00035 interface Tx_Extbase_Persistence_BackendInterface {
00036 
00037     /**
00038      * Sets the aggregate root objects
00039      *
00040      * @param Tx_Extbase_Persistence_ObjectStorage $objects
00041      * @return void
00042      */
00043     public function setAggregateRootObjects(Tx_Extbase_Persistence_ObjectStorage $objects);
00044 
00045     /**
00046      * Sets the deleted objects
00047      *
00048      * @param Tx_Extbase_Persistence_ObjectStorage $objects
00049      * @return void
00050      */
00051     public function setDeletedObjects(Tx_Extbase_Persistence_ObjectStorage $objects);
00052 
00053     /**
00054      * Commits the current persistence session
00055      *
00056      * @return void
00057      */
00058     public function commit();
00059 
00060     /**
00061      * Returns the (internal) identifier for the object, if it is known to the
00062      * backend. Otherwise NULL is returned.
00063      *
00064      * @param object $object
00065      * @return string The identifier for the object if it is known, or NULL
00066      */
00067     public function getIdentifierByObject($object);
00068 
00069     /**
00070      * Returns the object with the (internal) identifier, if it is known to the
00071      * backend. Otherwise NULL is returned.
00072      *
00073      * @param string $identifier
00074      * @param string $className
00075      * @return object The object for the identifier if it is known, or NULL
00076      */
00077     public function getObjectByIdentifier($identifier, $className);
00078 
00079     /**
00080      * Checks if the given object has ever been persisted.
00081      *
00082      * @param object $object The object to check
00083      * @return boolean TRUE if the object is new, FALSE if the object exists in the repository
00084      */
00085     public function isNewObject($object);
00086 
00087     /**
00088      * Replaces the given object by the second object.
00089      *
00090      * This method will unregister the existing object at the identity map and
00091      * register the new object instead. The existing object must therefore
00092      * already be registered at the identity map which is the case for all
00093      * reconstituted objects.
00094      *
00095      * The new object will be identified by the uuid which formerly belonged
00096      * to the existing object. The existing object looses its uuid.
00097      *
00098      * @param object $existingObject The existing object
00099      * @param object $newObject The new object
00100      * @return void
00101      */
00102     public function replaceObject($existingObject, $newObject);
00103 }
00104 ?>