forked from doctrine/doctrine1
-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
With #168 JSON support was introduced.
However, JSON fields cannot be persisted with Doctrine_Core::VALIDATE_TYPES enabled.
There is no way to pass \Doctrine_Validator::isValidType() for $type === 'json':
if ($var instanceof Doctrine_Expression) {
return true;
} elseif ($var === null) {
return true;
} elseif (is_object($var)) {
// This applies to JSON backed values with \stdClass values
return $type == 'object';
} elseif (is_array($var)) {
// This MIGHT (according to JSON condition below) apply to JSON backed values
return $type == 'array';
}
switch ($type) {
// [...]
case 'array':
return is_array($var);
case 'object':
return is_object($var);
case 'json':
// Even IF we ever reach here, e.g. with already json_encode()'d string,
// condition fails as the only two possible options already yielded <false> in the beginning.
return is_object($var) || is_array($var);
// [...]
}Metadata
Metadata
Assignees
Labels
No labels