mirror of
https://github.com/dg/dibi.git
synced 2025-08-04 05:07:36 +02:00
added JSON support [Closes #269]
This commit is contained in:
@@ -189,6 +189,7 @@ class Helpers
|
||||
'TIME' => Type::DATETIME, // DATETIME, TIMESTAMP
|
||||
'DATE' => Type::DATE,
|
||||
'BOOL' => Type::BOOL,
|
||||
'JSON' => Type::JSON,
|
||||
];
|
||||
|
||||
foreach ($patterns as $s => $val) {
|
||||
|
@@ -495,6 +495,9 @@ class Result implements IDataSource
|
||||
|
||||
} elseif ($type === Type::BINARY) {
|
||||
$row[$key] = $this->getResultDriver()->unescapeBinary($value);
|
||||
|
||||
} elseif ($type === Type::JSON) {
|
||||
$row[$key] = json_decode($value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -18,6 +18,7 @@ class Type
|
||||
public const
|
||||
TEXT = 's', // as 'string'
|
||||
BINARY = 'bin',
|
||||
JSON = 'json',
|
||||
BOOL = 'b',
|
||||
INTEGER = 'i',
|
||||
FLOAT = 'f',
|
||||
|
Reference in New Issue
Block a user