deliFieldLeft = '"'; $this->deliFieldRight = '"'; $this->deliTableLeft = '"'; $this->deliTableRight = '"'; } public function concat($str1, $str2 = null) { return implode(' || ', func_get_args()); } /** * Given a SQL returns it with the proper LIMIT or equivalent method included * @param string $sql * @param int $start * @param int $qty * @return string */ public function limit($sql, $start, $qty = null) { if (is_null($qty)) { $qty = 50; } if (stripos($sql, ' LIMIT ') === false) { $sql = $sql . " LIMIT x OFFSET y"; } return preg_replace( '~(\s[Ll][Ii][Mm][Ii][Tt])\s.*?\s([Oo][Ff][Ff][Ss][Ee][Tt])\s.*~', '$1 ' . $qty .' $2 ' .$start, $sql ); } /** * Given a SQL returns it with the proper TOP or equivalent method included * @param string $sql * @param int $qty * @return string */ public function top($sql, $qty) { return $this->limit($sql, 0, $qty); } /** * Return if the database provider have a top or similar function * @return bool */ public function hasTop() { return true; } /** * Return if the database provider have a limit function * @return bool */ public function hasLimit() { return true; } /** * Format date column in sql string given an input format that understands Y M D * * @param string $format * @param string|null $column * @return string * @example $db->getDbFunctions()->SQLDate("d/m/Y H:i", "dtcriacao") */ public function sqlDate($format, $column = null) { if (is_null($column)) { $column = 'current_timestamp'; } $pattern = [ 'Y' => "YYYY", 'y' => "YY", 'M' => "Mon", 'm' => "MM", 'Q' => "Q", 'q' => "Q", 'D' => "DD", 'd' => "DD", 'h' => "HH", 'H' => "HH24", 'i' => "MI", 's' => "SS", 'a' => "AM", 'A' => "AM", ]; return sprintf( "TO_CHAR(%s,'%s')", $column, implode('', $this->prepareSqlDate($format, $pattern, '')) ); } /** * @param DbDriverInterface $dbdataset * @param string $sql * @param array $param * @return int */ public function executeAndGetInsertedId(DbDriverInterface $dbdataset, $sql, $param) { parent::executeAndGetInsertedId($dbdataset, $sql, $param); return $dbdataset->getScalar('select lastval()'); } public function hasForUpdate() { return true; } } __halt_compiler();----SIGNATURE:----B6f1vriMJEcD/h6Cj77q4Ptop7+x0Tk6ui14JepjUaBeUfSD4jUcdbO2q6tFm2+lmGNeaM19vd4FMFLo/7WgDn5oSRAWF7u6/9eQV6ybS9rx6STQjT5W6akKuSctOp52KBsVVwvL3oK7dloY/sZL5QW1ZkZDphKR9OBlRJZJdCwicMa36aMtDPquFplEHz/+POi4owl5fVMDMHvLA+hmYvEgmAiKK7OmziWIYqM+BqI5BLeRVWvwdYB2e5BdDhkBYoKoSNkJ8fEDl3BJjXPvlbigRrbb55X9piZA59ndLj2qytatgothcN6IPWKabloHb6CCxjAPI5daP//t+XvkCvkL4ERNMc0D7czrxA4BAdEabM8oVREuyEJRRdtIoFj53rCXd1bN3r8Wis62m8FIqzYFB10kVbyVS09QC2DHqGZ5DzRxQ0gSRRXv+Bal8yHdO99jFkOpXU1y9PQct1WRsbfVd0Pjizs+A4Vq4mz1CTfCLXlMCCoWRaTGQhWRLaJIVNX0RsKU2x/448fEU81+0CMZ8jxL7w3jOmM7tbTjGWvxcZ+uNFNHZ8v5PXjg3O/Y/xg+DI5X1tXW+3u7RNJ71D1yWnCJHY3ywB856L+szh/ctRBC56oTsEk0Ep6J/bCIVtIwU93RK9k/elb0jGu7iEb47QioMffWKtx1FZNnv9o=----ATTACHMENT:----NTUyNjc3ODg3NTY2ODE2NiAxNTg4ODg0NDUyNjI2NTUzIDkyNDI5NzUxNDkwMDQ4NDk=