Min and Max
Min and Max
The use of min and max in your query can be easily done in ivory without have to add any other field to the query methods.
Example MIN
//import the ivory class
require_once('Operations.php');
//the instance of the ivory
$ivoryOrm = new Operations();
$arrSelect[] = "MIN(productValue)";
$arrSelect[] = "productName";
$tables[] = "products";
//the method select creates the query : SELECT MIN(productValue),productName FROM products;
$select = $ivoryOrm->select($arrSelect, $tables);
//the method runQuery is responsible to literally run your query into the database;
$result = $ivoryOrm->runQuery($select);
Example MAX
//import the ivory class
require_once('Operations.php');
//the instance of the ivory
$ivoryOrm = new Operations();
$arrSelect[] = "MAX(productValue)";
$arrSelect[] = "productName";
$tables[] = "products";
//the method select creates the query : SELECT MIN(productValue),productName FROM products;
$select = $ivoryOrm->select($arrSelect, $tables);
//the method runQuery is responsible to literally run your query into the database;
$result = $ivoryOrm->runQuery($select);