[+BUGFIX] Extbase: Removed a var_dump I committed accidentaly in the last commit
authorSebastian Kurfürst <sebastian@typo3.org>
Sun, 13 Sep 2009 18:50:42 +0000 (18:50 +0000)
committerSebastian Kurfürst <sebastian@typo3.org>
Sun, 13 Sep 2009 18:50:42 +0000 (18:50 +0000)
[TASK] Extbase: Went through TODO in code and changed some of them
[TASK] Extbase (Persistence): Deleted ChildNodeJoinCondition, as it is never used.

typo3/sysext/extbase/Classes/Configuration/Source/FlexFormSource.php
typo3/sysext/extbase/Classes/Persistence/Backend.php
typo3/sysext/extbase/Classes/Persistence/Mapper/DataMap.php
typo3/sysext/extbase/Classes/Persistence/Mapper/DataMapper.php
typo3/sysext/extbase/Classes/Persistence/QOM/ChildNodeJoinCondition.php [deleted file]
typo3/sysext/extbase/Classes/Persistence/QOM/ChildNodeJoinConditionInterface.php [deleted file]
typo3/sysext/extbase/Classes/Persistence/QOM/EquiJoinConditionInterface.php
typo3/sysext/extbase/Classes/Persistence/Storage/Typo3DbBackend.php
typo3/sysext/extbase/Classes/Property/Mapper.php
typo3/sysext/extbase/Classes/Utility/ClassLoader.php
typo3/sysext/extbase/Classes/Utility/TypoScript.php

index d2b3b97..958cbee 100644 (file)
@@ -78,7 +78,6 @@ class Tx_Extbase_Configuration_Source_FlexFormSource implements Tx_Extbase_Confi
         * @return void
         */
        private function readFlexformIntoConf($flexFormContent, &$settings, $recursive = FALSE) {
-               // TODO Do we need the $recursive argument here?
                if ($recursive === FALSE) {
                        $flexFormContent = t3lib_div::xml2array($flexFormContent, 'T3');
                }
index 5080507..f188169 100644 (file)
@@ -92,7 +92,6 @@ class Tx_Extbase_Persistence_Backend implements Tx_Extbase_Persistence_BackendIn
                $this->storageBackend = $storageBackend;
                $this->referenceIndex = t3lib_div::makeInstance('t3lib_refindex');
                $this->aggregateRootObjects = new Tx_Extbase_Persistence_ObjectStorage();
-               $this->persistenceBackend = $GLOBALS['TYPO3_DB']; // FIXME This is just an intermediate solution
        }
 
        /**
index 84142b7..bf4a1ee 100644 (file)
@@ -541,7 +541,7 @@ class Tx_Extbase_Persistence_Mapper_DataMap {
                        case Tx_Extbase_Persistence_PropertyType::DECIMAL:
                                return (float) $string;
                        case Tx_Extbase_Persistence_PropertyType::DATE:
-                               return new DateTime(strftime('%Y-%m-%d %H:%M:%S', $string)); // TODO Check for Time Zone issues
+                               return new DateTime(strftime('%Y-%m-%d %H:%M:%S', $string)); // TODO Check for Time Zone issues. Encode the time zone as well, and use the format defined by ISO used by TYPO3CR as well
                        case Tx_Extbase_Persistence_PropertyType::BOOLEAN:
                                return (boolean) $string;
                        default:
index 7692113..d727f3a 100644 (file)
@@ -253,12 +253,7 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
                        if (isset($parentKeyFieldName)) {
                                $objects = $query->matching($query->equals($columnMap->getParentKeyFieldName(), $parentObject->getUid()))->execute();
                        } else {
-                               // TODO Is it necessary to "normalize" and intval the list?
-                               $uids = t3lib_div::trimExplode(',', $fieldValue);
-                               $uidArray = array();
-                               foreach ($uids as $uid) {
-                                       $uidArray[] = (int)$uid;
-                               }
+                               $uidArray = t3lib_div::intExplode(',', $fieldValue);
                                $uids = implode(',', $uidArray);
                                // FIXME Using statement() is only a preliminary solution
                                $objects = $query->statement('SELECT * FROM ' . $columnMap->getChildTableName() . ' WHERE uid IN (' . $uids . ')')->execute();
diff --git a/typo3/sysext/extbase/Classes/Persistence/QOM/ChildNodeJoinCondition.php b/typo3/sysext/extbase/Classes/Persistence/QOM/ChildNodeJoinCondition.php
deleted file mode 100644 (file)
index 579c2f6..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-*  All rights reserved
-*
-*  This class is a backport of the corresponding class of FLOW3.
-*  All credits go to the v5 team.
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * Tests whether the childSelector node is a child of the parentSelector node. A
- * node-tuple satisfies the constraint only if:
- * childSelectorNode.getParent().isSame(parentSelectorNode)
- * would return true, where childSelectorNode is the node for childSelector and
- * parentSelectorNode is the node for parentSelector.
- *
- * @package Extbase
- * @subpackage Persistence\QOM
- * @version $Id: ChildNodeJoinCondition.php 2011 2009-03-18 14:22:24Z k-fish $
- * @scope prototype
- */
-// TODO: Do we use ChildNodeJoinCondition?
-class Tx_Extbase_Persistence_QOM_ChildNodeJoinCondition implements Tx_Extbase_Persistence_QOM_ChildNodeJoinConditionInterface {
-
-       /**
-        * @var string
-        */
-       protected $childSelectorName;
-
-       /**
-        * @var string
-        */
-       protected $parentSelectorName;
-
-       /**
-        * Constructs this ChildNodeJoinCondition instance
-        *
-        * @param Tx_Extbase_Persistence_QOM_DynamicOperandInterface $operand1
-        * @param Tx_Extbase_Persistence_QOM_StaticOperandInterface $operand2
-        */
-       public function __construct($childSelectorName, $parentSelectorName) {
-               $this->childSelectorName = $childSelectorName;
-               $this->parentSelectorName = $parentSelectorName;
-       }
-
-       /**
-        * Gets the name of the child selector.
-        *
-        * @return string the selector name; non-null
-        */
-       public function getChildSelectorName() {
-               return $this->childSelectorName;
-       }
-
-       /**
-        * Gets the name of the parent selector.
-        *
-        * @return string the selector name; non-null
-        */
-       public function getParentSelectorName() {
-               return $this->parentSelectorName;
-       }
-
-
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Persistence/QOM/ChildNodeJoinConditionInterface.php b/typo3/sysext/extbase/Classes/Persistence/QOM/ChildNodeJoinConditionInterface.php
deleted file mode 100644 (file)
index 08d74da..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-*  All rights reserved
-*
-*  This class is a backport of the corresponding class of FLOW3.
-*  All credits go to the v5 team.
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * Tests whether the childSelector node is a child of the parentSelector node. A
- * node-tuple satisfies the constraint only if:
- *  childSelectorNode.getParent().isSame(parentSelectorNode)
- * would return true, where childSelectorNode is the node for childSelector and
- * parentSelectorNode is the node for parentSelector.
- *
- * @package Extbase
- * @subpackage Persistence\QOM
- * @version $Id: ChildNodeJoinConditionInterface.php 1979 2009-03-09 15:44:15Z k-fish $
- */
-interface Tx_Extbase_Persistence_QOM_ChildNodeJoinConditionInterface extends Tx_Extbase_Persistence_QOM_JoinConditionInterface {
-
-       /**
-        * Gets the name of the child selector.
-        *
-        * @return string the selector name; non-null
-        */
-       public function getChildSelectorName();
-
-       /**
-        * Gets the name of the parent selector.
-        *
-        * @return string the selector name; non-null
-        */
-       public function getParentSelectorName();
-
-}
-
-?>
\ No newline at end of file
index 08d74da..9c03906 100644 (file)
@@ -36,7 +36,7 @@
  * @subpackage Persistence\QOM
  * @version $Id: ChildNodeJoinConditionInterface.php 1979 2009-03-09 15:44:15Z k-fish $
  */
-interface Tx_Extbase_Persistence_QOM_ChildNodeJoinConditionInterface extends Tx_Extbase_Persistence_QOM_JoinConditionInterface {
+interface Tx_Extbase_Persistence_QOM_EquiJoinConditionInterface extends Tx_Extbase_Persistence_QOM_JoinConditionInterface {
 
        /**
         * Gets the name of the child selector.
index 41b3b51..aa1dd59 100644 (file)
@@ -87,7 +87,9 @@ class Tx_Extbase_Persistence_Storage_Typo3DbBackend implements Tx_Extbase_Persis
                $fields = array();
                $values = array();
                $parameters = array();
-               unset($row['uid']); // TODO Check if the offset exists
+               if (isset($row['uid'])) {
+                       unset($row['uid']);
+               }
                foreach ($row as $columnName => $value) {
                        $fields[] = $columnName;
                        $values[] = '?';
@@ -528,7 +530,6 @@ class Tx_Extbase_Persistence_Storage_Typo3DbBackend implements Tx_Extbase_Persis
         * @return void
         */
        protected function addPageIdStatement($tableName, array &$sql) {
-               // TODO We have to call the appropriate API method if we are in TYPO3BE mode
                if (is_array($GLOBALS['TCA'][$tableName]['ctrl'])) {
                        $extbaseFrameworkConfiguration = Tx_Extbase_Dispatcher::getExtbaseFrameworkConfiguration();
                        $sql['additionalWhereClause'][] = $tableName . '.pid IN (' . implode(', ', t3lib_div::intExplode(',', $extbaseFrameworkConfiguration['persistence']['storagePid'])) . ')';
index 16f120d..2251eef 100644 (file)
@@ -241,7 +241,6 @@ class Tx_Extbase_Property_Mapper {
         * @return object
         */
        protected function transformToObject($propertyValue, $targetType, $propertyName) {
-               var_dump(func_get_args());
                if (is_numeric($propertyValue)) {
                        $propertyValue = $this->findObjectByUid($targetType, $propertyValue);
                        if ($propertyValue === FALSE) {
@@ -296,9 +295,6 @@ class Tx_Extbase_Property_Mapper {
                $object = NULL;
                if (count($result) > 0) {
                        $object = current($result);
-                       // TODO Check if the object is an Aggregate Root (this can be quite difficult because we have no Repository registration
-                       // SK: Is this TODO still needed?
-                       $this->persistenceManager->getSession()->registerReconstitutedObject($object);
                }
                return $object;
        }
index 4a119db..325fd0c 100644 (file)
@@ -44,7 +44,6 @@ class Tx_Extbase_Utility_ClassLoader {
         */
        public static function loadClass($className) {
                // TODO Remove debug code
-               // TODO Make a registry for Extbase classes
                //$starttime = microtime(true);
                $classNameParts = explode('_', $className, 3);
                $extensionKey = Tx_Extbase_Utility_Extension::convertCamelCaseToLowerCaseUnderscored($classNameParts[1]);
index 098e2fc..5a72c27 100644 (file)
@@ -33,8 +33,12 @@ class Tx_Extbase_Utility_TypoScript {
 
        /**
         * Removes all trailing dots recursively from TS settings array
-        * TODO Explain why we remove the dots.
         *
+        * Extbase converts the "classical" TypoScript (with trailing dot) to a format without trailing dot,
+        * to be more future-proof and not to have any conflicts with Fluid object accessor syntax.
+        *
+        * This method performs this removal.
+        * 
         * @param array $setup The settings array
         * @return void
         * @api