Yii Framework Forum: Custom Inflections - Yii Framework Forum

Jump to content

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

Custom Inflections Rate Topic: -----

#1 User is offline   Damián 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 05-March 13

Posted 06 March 2013 - 08:59 AM

I have an 'Inmueble' table with an 'id_propietario' fk; after generating the model I got this line:

'idPropietario' => array(self::BELONGS_TO, 'Propietario', 'id_propietario'),

Which leads to having to access the related object like this:

$propietario = $inmueble->idPropietario;

I also have a 'unidads' property when the correct would've been 'unidades'.
Is there any way to customize the inflector?
0

#2 User is offline   Keith 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,598
  • Joined: 04-March 10
  • Location:UK

Posted 06 March 2013 - 10:08 AM

I think you just need to manually update the model after you generate it.
0

#3 User is offline   Damián 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 05-March 13

Posted 06 March 2013 - 12:07 PM

I was afraid this was the only solution; thing is, I have quite a few models and not willing to edit every one.
Nonetheless, thanks for your answer :).
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