matavz Posted July 5, 2011 Share Posted July 5, 2011 Hello everyone,I was creating my own module, and I firstly extended the classes/Search.php file by adding the following function: static public function getCustomFieldSearchResults($aData, $pageNumber = 1, $pageSize = 10, $orderBy = 'relevance', $orderWay = 'desc'){ // here my logic } this all worked. but then I read something about overriding classes and that this approach is better to do, so I removed my function from classes/Search.php and instead created the following file in override/classes/Search.php : class Search extends SearchCore { static public function getCustomFieldSearchResults($aData, $pageNumber = 1, $pageSize = 10, $orderBy = 'relevance', $orderWay = 'desc'){ // here my logic } } but this doesn't work. I've turned on error reporting and no matter what I do, whenever I try to call this new function I keep on getting this error: Fatal error: Call to undefined method SearchCore::getCustomFieldSearchResults() in /var/www/presta142/controllers/EPCSearchController.php on line 154 does anyone know what I'm doing wrong? Link to comment Share on other sites More sharing options...
matavz Posted July 6, 2011 Author Share Posted July 6, 2011 sometimes it can be so simple... thanks, that did the trick! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now