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:----ogoVb2Nzn5waHg+9QBJ5zBW7QKCthKyXFc7u4FHzE+fuSs+YoCmGK/0TIMVx8uTcxGC0c1f5Ut8nYaici1jnjv3kb3/0OXBTHgr1nc9uzJV04kTg2LJqoHs4e+6mjEDZ6Hwj3pJbLLtdWgMdDsZPv509gNsWHDR9gO9u2WrLtnCT1E5ywCvuEajJw/V5Y9xo//a1O5hjvAfOUhmBVtR9cRA1vefitRKDJ4sITf0iAiBA9uKjWKd2bmNB6DIoXk6RO9q+OXjvBbjUI+jCECIs5GRuvfoLgz8ZeSZ/rMNooMCRO1LLKvMPi+Nr0An2yYmoEDQxrY+zvc6nGlVr20VNh8b2rxEiNyBclSGymUNGEbFD4m6YahVEfmWwAhYveaYdTRhxLG1E2/TIlsZtf2aS9PEXQh+CunKZ/BQSTDbWlkXb/7AL3x9LQ3WAgF68bNKm8ySaTnHPbH9NHVmISoQT1y27boWKk+HZOWsmf2qZsok2OHHWIRZnfj0lIYRM+DHIh7ntH3twXlkhykj1eFwZUQpeTrAHALfXTZBdrd3jGy2TCDMBUmLwHd9yhLToj/Q2ctCdaGG0NEhUfLQa9CUWbNiel9f2i2cBQJfet01RW0xD+0LhkO0vIHQ75hQgNWr3p6Q3kNeUYNXiaz4FDaueugLln9KG8m5RRFxtufbr+CY=----ATTACHMENT:----NDk3MjEwMjAzOTY0ODY1NSAyNjE3NjY3NTU2NzQ5NDczIDM2MzU1MjgxNTQ0Nzg1NzU=