Skip to content

Instantly share code, notes, and snippets.

@j6s
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j6s/1eb9edad8db1308368fe to your computer and use it in GitHub Desktop.
Save j6s/1eb9edad8db1308368fe to your computer and use it in GitHub Desktop.
/**
* @param array $filter
* @param array $fields
* @return array
*/
public function getFilterInfo($filter = array(),$fields = array()){
/**
* Formats the fields
*/
$statementFields = array();
foreach($fields as $f){
$statementFields[] = "MIN({$f})";
$statementFields[] = "MAX({$f})";
unset($f);
}
$statementFields = implode(",",$statementFields);
/**
* Gets a query object matching my filter
*/
$query = $this->getFilterQuery($filter);
/**
* Runs a custom statement on the query
*/
$query->statement("SELECT ? FROM tx_nimcarshop_domain_model_usedcar",array($statementFields));
/**
* Returns an array
*/
return $query->execute(true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment