Last active
August 29, 2015 14:03
-
-
Save j6s/1eb9edad8db1308368fe to your computer and use it in GitHub Desktop.
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
/** | |
* @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