Example #1
0
 /**
  * Returns result of the MIN($field) SQL query.
  *
  * @param string $field Name of the field.
  * @param array $conditions Conditions list.
  * @param type $debug Debug mode flag.
  *
  * @return int
  */
 public static function _min($field, $conditions = [], $debug = false)
 {
     $dbQuery = (new DBPreparedQuery())->prepare("SELECT MIN(`" . $field . "`) as 'val' FROM " . static::TABLE_NAME, $conditions);
     if (!$debug) {
         return DBCore::selectSingleValue($dbQuery);
     }
     $dbQuery->debug();
 }