mirror of
https://github.com/dg/dibi.git
synced 2025-08-12 00:54:11 +02:00
- removed 'FIELD_' from dibi data types
This commit is contained in:
@@ -226,17 +226,17 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
|
||||
/**
|
||||
* Encodes data for use in an SQL statement.
|
||||
* @param string value
|
||||
* @param string type (dibi::FIELD_TEXT, dibi::FIELD_BOOL, ...)
|
||||
* @param string type (dibi::TEXT, dibi::BOOL, ...)
|
||||
* @return string encoded value
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function escape($value, $type)
|
||||
{
|
||||
switch ($type) {
|
||||
case dibi::FIELD_TEXT:
|
||||
case dibi::TEXT:
|
||||
return $this->connection->quote($value, PDO::PARAM_STR);
|
||||
|
||||
case dibi::FIELD_BINARY:
|
||||
case dibi::BINARY:
|
||||
return $this->connection->quote($value, PDO::PARAM_LOB);
|
||||
|
||||
case dibi::IDENTIFIER:
|
||||
@@ -266,13 +266,13 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
|
||||
return $value;
|
||||
}
|
||||
|
||||
case dibi::FIELD_BOOL:
|
||||
case dibi::BOOL:
|
||||
return $this->connection->quote($value, PDO::PARAM_BOOL);
|
||||
|
||||
case dibi::FIELD_DATE:
|
||||
case dibi::DATE:
|
||||
return date("'Y-m-d'", $value);
|
||||
|
||||
case dibi::FIELD_DATETIME:
|
||||
case dibi::DATETIME:
|
||||
return date("'Y-m-d H:i:s'", $value);
|
||||
|
||||
default:
|
||||
@@ -285,7 +285,7 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver
|
||||
/**
|
||||
* Decodes data from result set.
|
||||
* @param string value
|
||||
* @param string type (dibi::FIELD_BINARY)
|
||||
* @param string type (dibi::BINARY)
|
||||
* @return string decoded value
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
|
Reference in New Issue
Block a user