Skip to content

Commit

Permalink
first support for typecasting to enable always correct format of data…
Browse files Browse the repository at this point in the history
…type
  • Loading branch information
Hedzer committed Sep 13, 2024
1 parent d63b075 commit db948d3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Doctrine/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,14 @@ protected function _get($fieldName, $load = true)
} else {
$value = $this->_data[$fieldName];
}

// Here we support typecasting, so we always return data in the format of the column
$type = $this->_table->getTypeOf($fieldName);
switch($type) {
case 'json':
$value = json_decode($value);
break;
}

return $value;
}
Expand Down

0 comments on commit db948d3

Please sign in to comment.