Yii Framework Forum: table1 does not have a method named "updateManyMany" - Yii Framework Forum

Jump to content

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

table1 does not have a method named "updateManyMany" when called by "afterSave()" Rate Topic: -----

#1 User is offline   Rico 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 15-October 09

Posted 20 October 2009 - 05:20 AM

hello ,
what can be wrong in the folowing code :

code in table1 controller :

public function updateManyMany() {

if ($this->isNewRecord) {
//..create records on table1_2 ...
} else {
//..update records on table1_2 ...
}
return true;
}

public function afterSave() {
$this->updateManyMany();
return parent::afterSave();
}


I try to overide the afterSave() on my table1 controller with a function -updateMany()- that is declared just "above" it and I get the error that this function is not part of the controller :-/

I don't see what's going on ..

if someone has a clue ?

thanks
Rico
0

#2 User is offline   tri 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,651
  • Joined: 20-November 08
  • Location:Stockholm, Sweden

Posted 20 October 2009 - 06:49 AM

...
I try to overide the afterSave() on my table1 controller with a function -updateMany()- that is declared just "above" it and I get the error that this function is not part of the controller :-/
...
[/quote]

That's because afterSave is a method of CActiveRecord.

/Tommy
Don't forget to read The Definitive Guide to Yii (en) (sv) | The class reference has the details
0

#3 User is offline   Rico 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 15-October 09

Posted 20 October 2009 - 08:22 AM

[quote name='tri' date='20 October 2009 - 12:49 PM' timestamp='1256039373' post='26588']
...
I try to overide the afterSave() on my table1 controller with a function -updateMany()- that is declared just "above" it and I get the error that this function is not part of the controller :-/
...
[/quote]

That's because afterSave is a method of CActiveRecord.

/Tommy
[/quote]
thanks Tommy,
your're right ...
works much better ;)

cheers !
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