![]() |
GAS ORM factory not working - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: External Resources (https://forum.codeigniter.com/forumdisplay.php?fid=7) +--- Forum: Addins (https://forum.codeigniter.com/forumdisplay.php?fid=13) +--- Thread: GAS ORM factory not working (/showthread.php?tid=74504) |
GAS ORM factory not working - plumpton - 10-03-2019 Hi, I have recently downloaded GAS ORM and I am trying to do some basic stuff to test how it works with Codeigniter. In my controller, I have the following code to test creating a 'user' record: $data = array('username' => 'test user', 'password' => 'test password', 'email' => 'test email'); $u = Gas::factory('User')->fill($data); But, it produces the following error. Can anyone help please as I'm not sure what the issue is. I have simply followed the instructions on the GAS ORM website and copied and pasted some examples. It's driving me nuts! Fatal error: Uncaught TypeError: Argument 1 passed to Gas::exception() must be an instance of Exception, instance of Error given, called in C:\server\webroot\myApp\application\libraries\gas.php on line 77 and defined in C:\server\webroot\myApp\application\libraries\gas.php:133 Stack trace: #0 C:\server\webroot\myApp\application\libraries\gas.php(77): Gas->exception(Object(Error)) #1 [internal function]: Gas->{closure}(Object(Error)) #2 {main} thrown in C:\server\webroot\myApp\application\libraries\gas.php on line 133 I also tried this but it gives the same error $u = Gas::factory('Model\User')->fill($data); But, if I do something like the following, it works fine and the User record is successfully added. $u = new Model\User; $u->username = 'test user'; $u->password = 'test password'; $u->email = 'test email'; $u->save(); Any ideas please? |