MY_Model Base CRUD Model - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: MY_Model Base CRUD Model (/showthread.php?tid=24361) |
MY_Model Base CRUD Model - El Forum - 12-17-2009 [eluser]happydude[/eluser] I want to make a suggestion for MY_Model. Please, add $limit and $offset to the functions that get many rows (get_many_by and get_all) as most times I have to write custom models to limit the amount of data and from where it gets fetched. I also need offset for pagination purposes. Thanks in advance. MY_Model Base CRUD Model - El Forum - 12-18-2009 [eluser]Jamie Rumbelow[/eluser] Update 1.1.1 A limit() method. Call it before any methods to add a LIMIT clause to your query. Takes two parameters - the limit integer and an optional offset. MY_Model Base CRUD Model - El Forum - 12-18-2009 [eluser]happydude[/eluser] errrm, sorry. Thank you so much for your fast response and fast action. This one just popped into my head one hour after I made my last post and I am just checking this thread now. An order_by method will be handy too. It should handle strings or multiple array containing fields with which the result set will be ordered and the order_by value (asc, desc, random). e.g. $this->product->order_by('sort = asc, date = desc')->get($id); //string and $this->product->order_by(array('sort' => 'asc', 'date' => 'desc')->get($id); //array Following your limit() method in the latest release, I've got something working on my end. Just thought I should let you know. It'll be my last request though for this library though. Thanks for the simple but great libraries. They are lifesavers. MY_Model Base CRUD Model - El Forum - 01-04-2010 [eluser]megabyte[/eluser] Quote:Tutorial Your website has changed. Can you give an update on where your tutorial is for your MY_Model please. I'm trying to learn more about it. Specifically: Code: /** Thanks. MY_Model Base CRUD Model - El Forum - 01-04-2010 [eluser]Jamie Rumbelow[/eluser] Sorry about that, the first post is updated. Jamie MY_Model Base CRUD Model - El Forum - 01-04-2010 [eluser]megabyte[/eluser] Jamie, In your future versions, will you be allowing for joins? I answered my question by rereading your first post! MY_Model Base CRUD Model - El Forum - 01-17-2010 [eluser]megabyte[/eluser] I'm getting this error using MY_Model Quote:Call to undefined method MY_Model::MY_Model() on line 18 Here's my code Code: class Countries_model extends MY_Model MY_Model Base CRUD Model - El Forum - 01-17-2010 [eluser]Jamie Rumbelow[/eluser] Hey megabyte, Can you show me the controller code you're using to load it? Jamie MY_Model Base CRUD Model - El Forum - 01-17-2010 [eluser]megabyte[/eluser] Code: class Countries extends Base { MY_Model Base CRUD Model - El Forum - 01-17-2010 [eluser]Jamie Rumbelow[/eluser] Hmm, I think I know what's going on here. Hang on. I'll edit when a fix has been made. EDIT Done. It's on the GitHub repo, check it out straight from master. |