Yii Framework Forum: ActiveRecord attributes binding after find - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

ActiveRecord attributes binding after find Rate Topic: -----

#1 User is offline   soso 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 45
  • Joined: 24-February 10

Posted 23 June 2010 - 06:50 AM

Hello all,

I have an ar model defined over a postgresql table. There is a field, weight that is stored as 'real' in database. After loading a record from db this field is retrieved as a php string instead of php double.

Example: in db I have 1.21 when loading it in the ar it is stored as "1.21" instead of 1.21.

Is this intendted behavior? If yes why? Because integers are converted to integers when fetched from db.

Thank you,
-soso
0

#2 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,339
  • Joined: 12-October 09
  • Location:Croatia

Posted 23 June 2010 - 06:55 AM

numeric data are represented with string in the AR...

check this thread - http://www.yiiframew...__fromsearch__1
Find more about me.... btw. Do you know your WAN IP?
0

#3 User is offline   soso 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 45
  • Joined: 24-February 10

Posted 23 June 2010 - 07:00 AM

View Postmdomba, on 23 June 2010 - 06:55 AM, said:

numeric data are represented with string in the AR...

check this thread - http://www.yiiframew...__fromsearch__1


Hi, it's not numeric, it's real, which is represented as double.
0

#4 User is offline   soso 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 45
  • Joined: 24-February 10

Posted 24 June 2010 - 02:32 AM

Any opionions guys? If not I will submit an official bug report.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users