[TASK] Deprecate SearchFormController->checkExistance 46/36046/3
authorStephan Großberndt <stephan@grossberndt.de>
Fri, 16 Jan 2015 16:09:42 +0000 (17:09 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 19 Jan 2015 17:11:55 +0000 (18:11 +0100)
Deprecate the function checkExistance (typo) in SearchFormController
and add a replacement checkExistence().

Releases: master
Resolves: #64315
Change-Id: I01d8b4d07f5f04e46052af296fbf93fed128e678
Reviewed-on: http://review.typo3.org/36046
Reviewed-by: Stephan Großberndt <stephan@grossberndt.de>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/indexed_search/Classes/Controller/SearchFormController.php

index bf71603..f73f1b4 100644 (file)
@@ -491,7 +491,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                        // Now, traverse result and put the rows to be displayed into an array
                        // Each row should contain the fields from 'ISEC.*, IP.*' combined + artificial fields "show_resume" (bool) and "result_number" (counter)
                        while (FALSE !== ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
-                               if (!$this->checkExistance($row)) {
+                               if (!$this->checkExistence($row)) {
                                        // Check if the record is still available or if it has been deleted meanwhile.
                                        // Currently this works for files only, since extending it to content elements would cause a lot of overhead...
                                        // Otherwise, skip the row.
@@ -1156,8 +1156,21 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
         *
         * @param array Result row array
         * @return bool Returns TRUE if record is still available
+        * @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
         */
        public function checkExistance($row) {
+               GeneralUtility::logDeprecatedFunction();
+               return $this->checkExistence($row);
+       }
+
+       /**
+        * Check if the record is still available or if it has been deleted meanwhile.
+        * Currently this works for files only, since extending it to page content would cause a lot of overhead.
+        *
+        * @param array Result row array
+        * @return bool Returns TRUE if record is still available
+        */
+       protected function checkExistence($row) {
                $recordExists = TRUE;
                // Always expect that page content exists
                if ($row['item_type']) {