Yii Framework Forum: Bug? Scenario Always Set To 'update' After Save. - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Bug? Scenario Always Set To 'update' After Save. Rate Topic: -----

#1 User is offline   Sarke 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 76
  • Joined: 25-October 10

Posted 25 September 2012 - 07:42 PM

I understand the logic that the default scenario on new models is 'insert' and the default on existing models is 'update'. However, I am setting a different scenario manually, but after saveing it still gets set to 'update'.

Is this intended behaviour? Maybe just have it set it as 'update' only if the scenario is 'insert' but leave it if it's something else (i.e. manually set). Thoughts?
0

#2 User is offline   samjf 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 44
  • Joined: 26-June 12

Posted 24 May 2013 - 02:57 PM

I'm with a similar problem. You found some solution?
Thanks
0

#3 User is offline   unique_yikes 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 30-August 10

Posted 07 June 2013 - 05:16 AM

It is an intended behaviour. From documentation of insert() method of ActiveRecord

After the record is inserted to DB successfully, its isNewRecord property will be set false,
and its scenario property will be set to be 'update'.

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

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