Yii Framework Forum: afterSave on extends CActiveRecord - Yii Framework Forum

Jump to content

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

afterSave on extends CActiveRecord Rate Topic: -----

#1 User is offline   thiagovidal 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 147
  • Joined: 17-February 10
  • Location:Brazil, São Paulo

Posted 24 June 2010 - 08:27 AM

Community I was trying to do the correct usage of the code but i thing it doesn't work or am I wrong. Its a bug?
if i remove the parent::afterSave then the code work.

public function afterSave()
{
	if(parent::afterSave())
	{
		return ...;
	}
}

0

#2 User is offline   tri 

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

Posted 24 June 2010 - 09:06 AM

View Postthiagovidal, on 24 June 2010 - 08:27 AM, said:

Community I was trying to do the correct usage of the code but i thing it doesn't work or am I wrong. Its a bug?
if i remove the parent::afterSave then the code work.

public function afterSave()
{
	if(parent::afterSave())
	{
		return ...;
	}
}



Signature is "protected void afterSave()"
protected function afterSave()
{
  parent::afterSave();
}

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

#3 User is offline   thiagovidal 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 147
  • Joined: 17-February 10
  • Location:Brazil, São Paulo

Posted 24 June 2010 - 09:21 AM

This works to beforeSave, beforeValidate and afterValidate too?

protected function beforeSave(){
parent::beforeSave()
...
}

where can I find more about this???
0

#4 User is offline   thiagovidal 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 147
  • Joined: 17-February 10
  • Location:Brazil, São Paulo

Posted 24 June 2010 - 09:27 AM

View Postthiagovidal, on 24 June 2010 - 09:21 AM, said:

This works to beforeSave, beforeValidate and afterValidate too?

protected function beforeSave(){
parent::beforeSave()
...
}

where can I find more about this???



Sorry... I got it now... I found on documentation. Sorry dudes!
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