[+BUGFIX] Extbase (Persistence): Fixed typo in Exception class.
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Persistence / Storage / Typo3DbBackend.php
index b0d2c74..6aecfd7 100644 (file)
@@ -172,7 +172,7 @@ class Tx_Extbase_Persistence_Storage_Typo3DbBackend implements Tx_Extbase_Persis
         */
        public function getRows(Tx_Extbase_Persistence_QOM_QueryObjectModelInterface $query) {
                $statement = $this->parseQuery($query);
-//             debug($statement, -2); // FIXME remove debug code
+               // debug($statement, -2); // FIXME remove debug code
                $result = $this->databaseHandle->sql_query($statement);
                $this->checkSqlErrors();
                if ($result) {
@@ -235,9 +235,7 @@ class Tx_Extbase_Persistence_Storage_Typo3DbBackend implements Tx_Extbase_Persis
                                $statement .= ' LIMIT ' . $sql['limit'];
                        }
                }
-
                $this->replacePlaceholders($statement, $parameters);
-               // debug($statement,-2);
                return $statement;
        }
 
@@ -549,7 +547,8 @@ class Tx_Extbase_Persistence_Storage_Typo3DbBackend implements Tx_Extbase_Persis
         * @return void
         */
        protected function addPageIdStatement($tableName, array &$sql) {
-               if (is_array($GLOBALS['TCA'][$tableName]['ctrl']) && $this->dataMapper->getDataMap($tableName)->hasPidColumn()) {
+               $columns = $this->databaseHandle->admin_get_fields($tableName);         
+               if (is_array($GLOBALS['TCA'][$tableName]['ctrl']) && array_key_exists('pid', $columns)) {
                        $extbaseFrameworkConfiguration = Tx_Extbase_Dispatcher::getExtbaseFrameworkConfiguration();
                        $sql['additionalWhereClause'][] = $tableName . '.pid IN (' . implode(', ', t3lib_div::intExplode(',', $extbaseFrameworkConfiguration['persistence']['storagePid'])) . ')';
                }
@@ -713,7 +712,8 @@ class Tx_Extbase_Persistence_Storage_Typo3DbBackend implements Tx_Extbase_Persis
                $pageIdsToClear = array();
                $storagePage = NULL;
 
-               if ($this->dataMapper->getDataMap($tableName)->hasPidColumn()) {
+               $columns = $this->databaseHandle->admin_get_fields($tableName);
+               if (array_key_exists('pid', $columns)) {
                        $result = $this->databaseHandle->exec_SELECTquery('pid', $tableName, 'uid='.intval($uid));
                        if ($row = $this->databaseHandle->sql_fetch_assoc($result))     {
                                $storagePage = $row['pid'];