[!!!] [TASK] Extbase (Persistence): Renamed Persistence_Backend->getUidByObject to...
authorSebastian Kurfürst <sebastian@typo3.org>
Mon, 3 Aug 2009 10:42:30 +0000 (10:42 +0000)
committerSebastian Kurfürst <sebastian@typo3.org>
Mon, 3 Aug 2009 10:42:30 +0000 (10:42 +0000)
typo3/sysext/extbase/Classes/Persistence/Backend.php
typo3/sysext/extbase/Classes/Persistence/BackendInterface.php
typo3/sysext/extbase/Classes/Persistence/IdentityMap.php
typo3/sysext/extbase/Classes/Persistence/Query.php
typo3/sysext/extbase/Classes/Persistence/Repository.php
typo3/sysext/extbase/Tests/Persistence/Repository_testcase.php

index fd0934f..82fc5f3 100644 (file)
@@ -186,9 +186,9 @@ class Tx_Extbase_Persistence_Backend implements Tx_Extbase_Persistence_BackendIn
         * @param object $object
         * @return string The identifier for the object if it is known, or NULL
         */
-       public function getUidByObject($object) {
+       public function getIdentifierByObject($object) {
                if ($this->identityMap->hasObject($object)) {
-                       return $this->identityMap->getUidByObject($object);
+                       return $this->identityMap->getIdentifierByObject($object);
                } else {
                        return NULL;
                }
@@ -201,7 +201,7 @@ class Tx_Extbase_Persistence_Backend implements Tx_Extbase_Persistence_BackendIn
         * @return boolean TRUE if the object is new, FALSE if the object exists in the repository
         */
        public function isNewObject($object) {
-               return ($this->getUidByObject($object) === NULL);
+               return ($this->getIdentifierByObject($object) === NULL);
        }
 
        /**
@@ -220,7 +220,7 @@ class Tx_Extbase_Persistence_Backend implements Tx_Extbase_Persistence_BackendIn
         * @return void
         */
        public function replaceObject($existingObject, $newObject) {
-               $existingUid = $this->getUidByObject($existingObject);
+               $existingUid = $this->getIdentifierByObject($existingObject);
                if ($existingUid === NULL) throw new Tx_Extbase_Persistence_Exception_UnknownObject('The given object is unknown to this persistence backend.', 1238070163);
 
                $this->identityMap->unregisterObject($existingObject);
index 77d5adb..bdcd00d 100644 (file)
@@ -64,7 +64,7 @@ interface Tx_Extbase_Persistence_BackendInterface {
         * @param object $object
         * @return string The identifier for the object if it is known, or NULL
         */
-       public function getUidByObject($object);
+       public function getIdentifierByObject($object);
 
        /**
         * Checks if the given object has ever been persisted.
index 523c632..58300ae 100644 (file)
@@ -93,7 +93,7 @@ class Tx_Extbase_Persistence_IdentityMap {
         * @param object $object
         * @return string
         */
-       public function getUidByObject($object) {
+       public function getIdentifierByObject($object) {
                return $this->objectMap[$object];
        }
 
index 804f480..096748e 100644 (file)
@@ -354,7 +354,7 @@ class Tx_Extbase_Persistence_Query implements Tx_Extbase_Persistence_QueryInterf
                $uniqueVariableName = uniqid($propertyName);
                if (is_object($operand) && !($operand instanceof DateTime)) {
                        // FIXME This branch of if-then-else is not fully backported and non functional by now
-                       $operand = $this->persistenceManager->getBackend()->getUidByObject($operand);
+                       $operand = $this->persistenceManager->getBackend()->getIdentifierByObject($operand);
                        $left = $source;
                        $columnMap = $this->dataMapper->getDataMap($this->className)->getColumnMap($propertyName);
                        $childSelectorName = $columnMap->getChildTableName();
index 215b0ba..4805447 100644 (file)
@@ -94,7 +94,7 @@ class Tx_Extbase_Persistence_Repository implements Tx_Extbase_Persistence_Reposi
        public function replace($existingObject, $newObject) {
                $backend = $this->persistenceManager->getBackend();
                $session = $this->persistenceManager->getSession();
-               $uid = $backend->getUidByObject($existingObject);
+               $uid = $backend->getIdentifierByObject($existingObject);
                if ($uid !== NULL) {
                        $backend->replaceObject($existingObject, $newObject);
                        $session->unregisterReconstitutedObject($existingObject);
index 3d29a0f..d76c03c 100644 (file)
@@ -165,7 +165,7 @@ class Tx_Extbase_Persistence_Repository_testcase extends Tx_Extbase_Base_testcas
                $newObject = new $this->aggregateRootClassName;
        
                $mockPersistenceBackend = $this->getMock('Tx_Extbase_Persistence_BackendInterface');
-               $mockPersistenceBackend->expects($this->once())->method('getUidByObject')->with($existingObject)->will($this->returnValue(123));
+               $mockPersistenceBackend->expects($this->once())->method('getIdentifierByObject')->with($existingObject)->will($this->returnValue(123));
                $mockPersistenceBackend->expects($this->once())->method('replaceObject')->with($existingObject, $newObject);
        
                $mockPersistenceSession = $this->getMock('Tx_Extbase_Persistence_Session', array(), array(), '', FALSE);
@@ -189,8 +189,8 @@ class Tx_Extbase_Persistence_Repository_testcase extends Tx_Extbase_Base_testcas
                $existingObject = new $this->aggregateRootClassName;
                $newObject = new $this->aggregateRootClassName;
        
-               $mockPersistenceBackend = $this->getMock('Tx_Extbase_Persistence_Backend', array('getUidByObject'), array(), '', FALSE);
-               $mockPersistenceBackend->expects($this->once())->method('getUidByObject')->with($existingObject)->will($this->returnValue(NULL));
+               $mockPersistenceBackend = $this->getMock('Tx_Extbase_Persistence_Backend', array('getIdentifierByObject'), array(), '', FALSE);
+               $mockPersistenceBackend->expects($this->once())->method('getIdentifierByObject')->with($existingObject)->will($this->returnValue(NULL));
 
                $mockPersistenceManager = $this->getMock('Tx_Extbase_Persistence_ManagerInterface');
                $mockPersistenceManager->expects($this->once())->method('getBackend')->will($this->returnValue($mockPersistenceBackend));