![]() |
Undefined method stdClass::save()? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Undefined method stdClass::save()? (/showthread.php?tid=27303) |
Undefined method stdClass::save()? - El Forum - 02-06-2010 [eluser]rockstyle[/eluser] Something like this in method when i submit: Code: $bank->title = $this->input->post('title'); And Error I got: Code: Fatal error: Call to undefined method stdClass::save() in... Help ![]() Undefined method stdClass::save()? - El Forum - 02-06-2010 [eluser]theprodigy[/eluser] need a little more information please. Is your $bank class a custom library, model, etc What methods do you have written for it? If it's a model, are you extending an ORM of some kind, extending Model, etc Undefined method stdClass::save()? - El Forum - 02-07-2010 [eluser]rockstyle[/eluser] I'm mainly using Doctrine. $bank is an object with variables from database table. I think just save(); doesn't work but can't figure out why... Code: public function submit() { Just that is executed when i click submit button, but view doesn't load and there is error ![]() Undefined method stdClass::save()? - El Forum - 02-07-2010 [eluser]theprodigy[/eluser] try commenting out the save method, and print_r-ing the $bank object. this may be a simple question (and due to debugging purpose, please don't get offended by any implications), but are you loading the bank model? Is your bank model extending Doctrine_Record and not Model? Undefined method stdClass::save()? - El Forum - 02-07-2010 [eluser]rockstyle[/eluser] Code: stdClass Object ( [title] => Otwartapestka.pl [url] => http://otwartapestka.pl [description] => Zasiejemy cala Polske [forum_url] => http://otwartapeskta.info/viewtopic.php?v=23123 [updated_at] => 2010-02-07 12:10:24 ) And Model which obviously extends Doctrine_record Code: <?php Maybe I'll ask differently. What requirements has save(); function to be executed? Undefined method stdClass::save()? - El Forum - 02-07-2010 [eluser]theprodigy[/eluser] is 'bank' also the name of the table in your database, or is your database table something different? EDIT: Also, I don't see anywhere that you are instantiating the object: Code: $bank = new Bank(); Undefined method stdClass::save()? - El Forum - 02-08-2010 [eluser]rockstyle[/eluser] works out now, thank you. I guess i was wrong about new instruction. Thank you ![]() |