Yii Framework Forum: Activerecord::with Parameter Alias Is Not Working Anymore - Yii Framework Forum

Jump to content

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

Activerecord::with Parameter Alias Is Not Working Anymore upgrade from version 1.12 to 1.13 Rate Topic: -----

#1 User is offline   datatraders 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 25-June 09

Posted 04 January 2013 - 06:20 PM

The documentation said for ActiveRecord::with

By default, the options specified in relations() will be used to do relational query. In order to customize the options on the fly, we should pass an array parameter to the with() method. The array keys are relation names, and the array values are the corresponding query options.

Post::model()->with(array(
'author'=>array('select'=>'id, name'),
'comments'=>array('condition'=>'approved=1', 'order'=>'create_time'),
))->findAll();

a option like 'alias'=>'myComments' is ignored in version 1.13.
Is there a new way to specify a dynamlic alias for joined table?

Best regards - Jens
0

#2 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,074
  • Joined: 16-February 11
  • Location:Japan

Posted 05 January 2013 - 03:26 AM

Hi datatraders,

It might be a bug introduced in 1.1.13.
I think you should report it as an issue in github.
https://github.com/y...sues?state=open
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