Ticket #406 (closed Patch: fixed)
Propsed change to ORM::__call() for 'as_array' to support correct datatype translation
| Reported by: | sbeattie | Owned by: | Shadowhand |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.2 |
| Component: | Libraries:ORM | Version: | SVN HEAD |
| Keywords: | as_array | Cc: |
Description
I ran into an issue where all values were returned as strings...
from line 214:
/**
* Returns an array of all the
*/
if ($method === 'as_array')
{
// Return all of the object data as an array
$arr = array();
foreach( self::$fields[$this->table] as $field => $data )
{
switch( $data['type'] )
{
case 'int':
$arr["$field"] = (int) $this->object->$field;
break;
case 'float':
$arr["$field"] = (float) $this->object->$field;
break;
default:
$arr["$field"] = $this->object->$field;
break;
}
}
return $arr;
}
Change History
Note: See
TracTickets for help on using
tickets.
