Skip to content

Commit

Permalink
psr2 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jedateach committed Jul 3, 2019
1 parent acdb844 commit 783b1a9
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions code/ProductFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
/**
* ProductFinder is a stand-alone page for searching and filtering products,
* reachable by default at yoursite.com/search.
*
*
* Pass a 'search' get parameter in the url to perform the search.
*
*
* TODO:
* sort results by popularity, newest
* choose number of results
Expand All @@ -13,11 +13,10 @@
* search module
* fuzzy search
* mispelling
*
*
*/
class ProductFinder extends Page_Controller
{

public static $url_segment = "products";

public function Title()
Expand Down Expand Up @@ -48,11 +47,15 @@ public function getSorter()
{
$sorts = array(
'Most Popular' => 'Popularity DESC',
ListSorter_Option::create('Title (A - Z)', "Title ASC",
ListSorter_Option::create(
'Title (A - Z)',
"Title ASC",
ListSorter_Option::create('Title (Z - A)', "Title DESC")
->setID("title desc")
)->setID("title asc"),
ListSorter_Option::create('Newest', "Created DESC",
ListSorter_Option::create(
'Newest',
"Created DESC",
ListSorter_Option::create('Oldest', "Created ASC")
)
);
Expand Down Expand Up @@ -96,10 +99,10 @@ protected function results($phrase = null)

return $products;
}
/**
* @return DataQuery
*/
/**
* @return DataQuery
*/
protected function query($phrase)
{
$phrase = Convert::raw2sql($phrase); //prevent sql injection
Expand All @@ -126,8 +129,8 @@ protected function query($phrase)
}
$query->where("(".implode(" OR ", $likes).")");
}
return $query;
}
return $query;
}

protected function matchFields()
{
Expand Down

0 comments on commit 783b1a9

Please sign in to comment.