IgnitedRecord 1.0 pre-release - 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: IgnitedRecord 1.0 pre-release (/showthread.php?tid=7996) |
IgnitedRecord 1.0 pre-release - El Forum - 12-09-2008 [eluser]Muser[/eluser] OH! Thanks!! I'll try it!! Now, I was trying this: Code: class User extends IgnitedRecord { And not works Is showing a notice error on line 515 of ignitedrecord.php Code: function add_hook($name, $function, $priority = 10) Why? IgnitedRecord 1.0 pre-release - El Forum - 12-09-2008 [eluser]Cannyp[/eluser] Hi there, quick question. Why does calling save() on an object which hasn't had any properties modified cause an ERROR in the codeigniter log? Just curious? (Im now checking to see whether the property has been modified first) Is this by design? thanks again Martin IgnitedRecord 1.0 pre-release - El Forum - 12-09-2008 [eluser]m4rw3r[/eluser] I've fixed that error with the add_hook() method, and also lowered the error level to debug for the event when save() does not save the object because it is unchanged. IgnitedRecord 1.0 pre-release - El Forum - 12-10-2008 [eluser]Muser[/eluser] m4rw3r, I really apreciate your support! Thanks !! IgnitedRecord 1.0 pre-release - El Forum - 12-10-2008 [eluser]Muser[/eluser] I can't understand this: Code: <?php In vehicle controller method index, I can list the vehicles and his brand name with vehiclebrand_name property. GOOD! But... Then in vehicle controller method brand (I want to list the vehicles of a brand) : Code: /* Why I get this error for each vehicle object? <h4>A PHP Error was encountered</h4> <p>Severity: Notice</p> <p>Message: Undefined property: IR_record::$vehiclebrand_name</p> <p>Filename: helpers/vehicle_helper.php</p> <p>Line Number: 12</p> Are hooks executing when I use ->related('vehicles')->get() ?? I tried not to use hooks too, and I tried to extend find_by and find_all_by methods with no result . What I'm missing?? IgnitedRecord 1.0 pre-release - El Forum - 12-11-2008 [eluser]m4rw3r[/eluser] Hooks does not execute with related(), which is something that I might need to implement. So you have to call related('vehicles')->join_related('vehiclebrand', 'name')->get() instead. IgnitedRecord 1.0 pre-release - El Forum - 12-11-2008 [eluser]Muser[/eluser] mmm When I call Code: $brand->related('vehicles')->join_related('vehiclebrand','name')->get(); I get a strange SQL syntax error: SELECT `vehiclebrand`.`vehicles` AS `vehiclebrand_vehicles`, `vehiclebrand`.`id` AS `vehiclebrand_id`, `vehiclebrand`.`` AS `vehiclebrand_`, `vehiclebrand`.`IR_record` AS `vehiclebrand_IR_record`, `vehiclebrand`.`Array` AS `vehiclebrand_Array`, `vehiclebrand`.`Array` AS `vehiclebrand_Array`, `vehiclebrand`.`Array` AS `vehiclebrand_Array`, `vehiclebrand`.`Array` AS `vehiclebrand_Array`, `vehiclebrand`.`Array` AS `vehiclebrand_Array`, `vehiclebrand`.`` AS `vehiclebrand_`, `vehiclebrand`.`Array` AS `vehiclebrand_Array`, `vehiclebrand`.`Array` AS `vehiclebrand_Array`, `vehiclebrand`.`Array` AS `vehiclebrand_Array`, `vehiclebrand`.`Array` AS `vehiclebrand_Array`, `vehiclebrand`.`` AS `vehiclebrand_`, `vehiclebrand`.`Array` AS `vehiclebrand_Array`, `vehiclebrand`.`` AS `vehiclebrand_`, `vehiclebrand`.* AS `vehiclebrand_*`, `vehiclebrand`.`` AS `vehiclebrand_`, `vehiclebrand`.`Array` AS `vehiclebrand_Array`, `vehiclebrand`.`Array` AS `vehiclebrand_Array`, `vehiclebrand`.`Array` AS `vehiclebrand_Array`, `vehiclebrand`.`Array` AS `vehiclebrand_Array`, `vehiclebrand`.`Array` AS `vehiclebrand_Array`, `vehiclebrand`.`Array` AS `vehiclebrand_Array`, `vehiclebrand`.`` AS `vehiclebrand_`, `vehiclebrand`.`` AS `vehiclebrand_`, `vehiclebrand`.`` AS `vehiclebrand_`, `vehiclebrand`.`Array` AS `vehiclebrand_Array`, `vehiclebrand`.`Array` AS `vehiclebrand_Array`, `vehiclebrand`.`` AS `vehiclebrand_`, `vehiclebrand`.`Array` AS `vehiclebrand_Array`, `vehiclebrand`.`` AS `vehiclebrand_`, `vehiclebrand`.`` AS `vehiclebrand_`, `vehiclebrand`.`` AS `vehiclebrand_`, `vehiclebrand`.`` AS `vehiclebrand_`, `vehiclebrand`.`` AS `vehiclebrand_`, `vehiclebrand`.`` AS `vehiclebrand_`, `vehiclebrand`.`mysql` AS `vehiclebrand_mysql`, `vehicles`.* FROM `vehicles` JOIN `vehiclebrands` AS `vehiclebrand` ON .vehiclebrand_id = vehiclebrand.id WHERE `vehicles`.`vehiclebrand_id` = '19' IgnitedRecord 1.0 pre-release - El Forum - 12-11-2008 [eluser]m4rw3r[/eluser] I tried the code, and found that related()'s join_related() method is flawed. Probably occurred when I implemented the Through relationship. I have now fixed that error, so update IR and try again. Hope it works! (Tell me if it isn't) IgnitedRecord 1.0 pre-release - El Forum - 12-11-2008 [eluser]Muser[/eluser] SOLVED!! :exclaim: SELECT `vehiclebrand`.`name` AS `vehiclebrand_name`, `vehicles`.* FROM `vehicles` LEFT JOIN `vehiclebrands` AS `vehiclebrand` ON vehicles.vehiclebrand_id = vehiclebrand.id WHERE `vehicles`.`vehiclebrand_id` = '19' Thank you! nake: IgnitedRecord 1.0 pre-release - El Forum - 12-13-2008 [eluser]Unknown[/eluser] Hi, i have question about cascade_on_delete, how this should be set up? Code: public $belongs_to = array( all other things but cascade on delete seem to work. thanks Jaan |