/** * get a function format string * * @param rdbms.SQLFunction $func * @return string * @throws lang.IllegalArgumentException */ public function formatFunction(\rdbms\SQLFunction $func) { if ('concat' == $func->func) { return '(' . implode(' + ', array_fill(0, sizeof($func->args), '%s')) . ')'; } return parent::formatFunction($func); }
/** * get a dialect specific datepart * * @param string datepart * @return string * @throws lang.IllegalArgumentException */ public function datepart($datepart) { $datepart = strToLower($datepart); if (!array_key_exists($datepart, self::$dateparts)) { return parent::datepart($datepart); } if (false === self::$dateparts[$datepart]) { throw new \lang\IllegalArgumentException('MYSQL does not support datepart ' . $datepart); } return self::$dateparts[$datepart]; }