getDbFunctions()->SQLDate("d/m/Y H:i", "dtcriacao") */ abstract public function sqlDate($format, $column = null); protected function prepareSqlDate($input, $pattern, $delimitString = "'") { $prepareString = preg_split('/([YyMmQqDdhHisaA])/', $input, -1, PREG_SPLIT_DELIM_CAPTURE); foreach ($prepareString as $key => $value) { if ('' === $value) { unset($prepareString[$key]); continue; } if (isset($pattern[$value])) { $formatted = $pattern[$value]; } else { $formatted = $delimitString . $value . $delimitString; } $prepareString[$key] = $formatted; } return $prepareString; } /** * Format a string date to a string database readable format. * * @param string $date * @param string $dateFormat * @return string */ public function toDate($date, $dateFormat) { $dateTime = DateTime::createFromFormat($dateFormat, $date); return $dateTime->format(self::YMDH); } /** * Format a string database readable format to a string date in a free format. * * @param string $date * @param string $dateFormat * @return string */ public function fromDate($date, $dateFormat) { $dateTime = DateTime::createFromFormat(self::YMDH, $date); return $dateTime->format($dateFormat); } /** * @param DbDriverInterface $dbdataset * @param string $sql * @param array $param * @return int */ public function executeAndGetInsertedId(DbDriverInterface $dbdataset, $sql, $param) { $dbdataset->execute($sql, $param); return $dbdataset->getDbConnection()->lastInsertId(); } /** * @param array|string $field * @return mixed */ public function delimiterField($field) { $result = []; foreach ((array)$field as $fld) { $fldAr = explode('.', $fld); $result[] = $this->deliFieldLeft . implode($this->deliFieldRight . '.' . $this->deliFieldLeft, $fldAr) . $this->deliFieldRight; } if (is_string($field)) { return $result[0]; } return $result; } public function delimiterTable($table) { $tableAr = explode('.', $table); return $this->deliTableLeft . implode($this->deliTableRight . '.' . $this->deliTableLeft, $tableAr) . $this->deliTableRight; } public function forUpdate($sql) { if (!preg_match('#\bfor update\b#i', $sql)) { $sql = $sql . " FOR UPDATE "; } return $sql; } abstract public function hasForUpdate(); } __halt_compiler();----SIGNATURE:----OupWPAHtM3CobgDrIneogMyv9ixXUsOzSHmikbCphM6/cqU10kLpkdhpL0Ts/0mBIxj4Lu4fcBdJRYEJLySiFghOdWXKs6EYdte2Qwry8l2i4q4dzWc23ajFzn4HsqrFZ+2nUBRxAZhY1ybUz7JeGB1zNy7wWnjyU9enfdZjzD3SGsxXeQesnNHol3Usl0moPPiv3AtjcbP1XI1bZZ+FE3FKhvn4rIc5X6dkbm34A67xwm5x4tSnMarNw2FiPqw0N3liYWeEm46slfeiO3kIONlba2gVN1dQqRNqSPO1NIX6TOEbDUhXhb236uhkOYWJ/AQEyUO4kmRuhV2e8v152vYhIl4Ci9wA8bGAn/RsukRink+RU6Fx/pB4PGVyNM3VKui8d+Z4wHBTxpPCV1xOJXyWo0ysZI+Dmch9DPd3r5xL0LdOjFIMcqmurAlsWNX+3+iOSBFUkW5bEFtFWUVhuCFRDYB37Z8eFmn5dZFNusa02txU9QeT2NDcWSTWjbJyyTz5P4fbdrAx3F28KV3GGfm96jMiE4Rst8aMys5rEIJAe+fWfwUnOuqv8H9SyfaDFJBLtIbvfhET/+JQllp1wEB8dFgKFuI+YSJHAEhTOngydlko5IFSIt5yXK9Nu26Rmcfh4J4gml5w0J6lpTBkexqi4Aror5y+Jb6Ll94Dnig=----ATTACHMENT:----MzM2NDQyMzQ1NDAxMTM1OCA3MzAyMTQyMTIwMzU3NDczIDY1OTgzNDgzNjYzMzQ2NQ==