This repository has been archived by the owner on Mar 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FACTFINDER-178] Rewrite Fulltext model to prevent sql exceptions #157
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
src/app/code/community/FACTFinder/Core/Model/Resource/Fulltext.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* FACTFinder_Core | ||
* | ||
* @category Mage | ||
* @package FACTFinder_Core | ||
* @author Flagbit Magento Team <[email protected]> | ||
* @copyright Copyright (c) 2016 Flagbit GmbH & Co. KG | ||
* @license https://opensource.org/licenses/MIT The MIT License (MIT) | ||
* @link http://www.flagbit.de | ||
* | ||
*/ | ||
|
||
/** | ||
* Model class | ||
* | ||
* @category Mage | ||
* @package FACTFinder_Core | ||
* @author Flagbit Magento Team <[email protected]> | ||
* @copyright Copyright (c) 2016 Flagbit GmbH & Co. KG (http://www.flagbit.de) | ||
* @license https://opensource.org/licenses/MIT The MIT License (MIT) | ||
* @link http://www.flagbit.de | ||
*/ | ||
class FACTFinder_Core_Model_Resource_Fulltext extends Mage_CatalogSearch_Model_Resource_Fulltext | ||
{ | ||
|
||
|
||
/** | ||
* Override this method to prevent making unnecessary sql requests if FF is enabled | ||
* | ||
* @param Mage_CatalogSearch_Model_Fulltext $object | ||
* @param string $queryText | ||
* @param Mage_CatalogSearch_Model_Query $query | ||
* | ||
* @return FACTFinder_Core_Model_Resource_Fulltext | ||
*/ | ||
public function prepareResult($object, $queryText, $query) | ||
{ | ||
if (Mage::helper('factfinder')->isEnabled()) { | ||
return $this; | ||
} | ||
|
||
return parent::prepareResult($object, $queryText, $query); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters