My entity manager cannot remove a record (CodeIgniter 2.0.3 + Doctrine 2.0 + HMVC) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: My entity manager cannot remove a record (CodeIgniter 2.0.3 + Doctrine 2.0 + HMVC) (/showthread.php?tid=44832) |
My entity manager cannot remove a record (CodeIgniter 2.0.3 + Doctrine 2.0 + HMVC) - El Forum - 08-28-2011 [eluser]goFrendiAsgard[/eluser] What I want? a simple CRUD capability with CodeIgniter, HMVC & Doctrine What I've tried? I made a module inside modules directory Here is the directory structure: application: modules lab controllers module.php models mod_module.php views Here is the codes inside mod_module.php Code: namespace lab\models; Code: $module = $this->doctrine->em->find('lab\models\mod_module', $key); $key contains the id of a specific record in mod_module table. $menuValue and $moduleValue are the new values of the respective fields. It worked as expected, But whenever I perform remove, it is always failed Code: $module = $this->doctrine->em->find('lab\models\mod_module', $key); The record doesn't deleted, I've check the variables value via var_dump, and I think nothing wrong. Another thing, if I use DQL instead of "remove" and "flush", it will work as expected, th record deleted..... Code: $dql = "DELETE What I expect? Not much, I want that "remove" and "flush" worked,.... I can use DQL, but I think "remove" and "flush" make my codes easier to read,..... Thank you in advance, ~goFrendiAsgard My entity manager cannot remove a record (CodeIgniter 2.0.3 + Doctrine 2.0 + HMVC) - El Forum - 03-13-2012 [eluser]stcoid1[/eluser] hi, Try this code ON CONTROLLER Code: function xxxx Happy Coding |