Re: [CakePHP : The Rapid Development Framework for PHP] #6276: afterFind() called twice / documentation does not match behaviour
#6276: afterFind() called twice / documentation does not match behaviour --+- Reporter: nemosoft | Owner: Type: RFC|Status: new Priority: Medium | Milestone: 1.2.x.x Component: Model | Version: 1.2 Final Severity: Normal |Resolution: Keywords: afterFind primary data corruption | Php_version: PHP 5 Cake_version: 8120 | --+- Comment (by Pichan): Still nothing? I'd at least like an official opinion on this ticket.[[BR]] Is it supposed to do that? Is the code wrong or are the docs wrong?[[BR]] I have no idea what kind of problems the devs are facing elsewhere since this is my first time using trac here but at least from my point of view cake acting like this is an annoyance. A minor one but still one.[[BR]] At least how I see it, having to identify data only by it's structure should be avoided. -- Ticket URL: https://trac.cakephp.org/ticket/6276#comment:5 CakePHP : The Rapid Development Framework for PHP https://trac.cakephp.org/ Cake is a rapid development framework for PHP which uses commonly known design patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups tickets cakephp group. To post to this group, send email to tickets-cakephp@googlegroups.com To unsubscribe from this group, send email to tickets-cakephp+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/tickets-cakephp?hl=en -~--~~~~--~~--~--~---
Re: [CakePHP : The Rapid Development Framework for PHP] #6276: afterFind() called twice / documentation does not match behaviour
#6276: afterFind() called twice / documentation does not match behaviour --+- Reporter: nemosoft | Owner: Type: RFC|Status: new Priority: Medium | Milestone: 1.2.x.x Component: Model | Version: 1.2 Final Severity: Normal |Resolution: Keywords: afterFind primary data corruption | Php_version: PHP 5 Cake_version: 8120 | --+- Comment (by eimermusic): Last year I detailed the differences in data I had found. It is available in the thread below. The thread also contains a method for AppModel that helps to hide these inconsistencies from the rest of your app (use Matt's version from December). As for the double-calls with the same data I still use custom checks in my afterFinds to not unserialize / decrypt twice. [[BR]] [[BR]] [http://groups.google.com/group/cake- php/browse_thread/thread/32ab9f8baed4a05a] -- Ticket URL: https://trac.cakephp.org/ticket/6276#comment:3 CakePHP : The Rapid Development Framework for PHP https://trac.cakephp.org/ Cake is a rapid development framework for PHP which uses commonly known design patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups tickets cakephp group. To post to this group, send email to tickets-cakephp@googlegroups.com To unsubscribe from this group, send email to tickets-cakephp+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/tickets-cakephp?hl=en -~--~~~~--~~--~--~---
Re: [CakePHP : The Rapid Development Framework for PHP] #6276: afterFind() called twice / documentation does not match behaviour
#6276: afterFind() called twice / documentation does not match behaviour --+- Reporter: nemosoft | Owner: Type: RFC|Status: new Priority: Medium | Milestone: 1.2.x.x Component: Model | Version: 1.2 Final Severity: Normal |Resolution: Keywords: afterFind primary data corruption | Php_version: PHP 5 Cake_version: 8120 | --+- Comment (by deizel): Please bear in mind I have done next to no research before posting this: Just an observation, but without the second pass it would make it difficult for someone to merge two records together in an afterFind() callback. I can't immediately think of a solid reason why someone might want to do this, but if there was a flag similar to $primary - one could check for this during the second pass, and this would remain a possibility. Alternatively, the first pass(es) could be scrapped, and the developer could implement record-looping himself as is documented: {{{ function afterFind($results, $primary) { foreach ($results as $result) { $result = $this-_combineNames($result); $result = $this-_calculateTotal($result); } return parent::afterFind($results, $primary); } }}} Apologies if I am oversimplifying things here - just food for thought - feel free to correct me on anything I have overlooked. -- Ticket URL: https://trac.cakephp.org/ticket/6276#comment:2 CakePHP : The Rapid Development Framework for PHP https://trac.cakephp.org/ Cake is a rapid development framework for PHP which uses commonly known design patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups tickets cakephp group. To post to this group, send email to tickets-cakephp@googlegroups.com To unsubscribe from this group, send email to tickets-cakephp+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/tickets-cakephp?hl=en -~--~~~~--~~--~--~---
Re: [CakePHP : The Rapid Development Framework for PHP] #6276: afterFind() called twice / documentation does not match behaviour
#6276: afterFind() called twice / documentation does not match behaviour --+- Reporter: nemosoft | Owner: Type: RFC|Status: new Priority: Medium | Milestone: 1.2.x.x Component: Model | Version: 1.2 Final Severity: Normal |Resolution: Keywords: afterFind primary data corruption | Php_version: PHP 5 Cake_version: 8120 | --+- Comment (by derkyjadex): I am having the same problem here, version 8166. I would say that in the associated model, afterFind() should only be called once for each result returned, and with the structure given in the current documentation. Otherwise the developer would always have to dig through layers of arrays for what is always a single result. I also see no reason for the second pass. The associated model would have to know about the defined associations in the primary model to make any use of the extra data. Logic that requires this would be better placed in the primary afterFind(). -- Ticket URL: https://trac.cakephp.org/ticket/6276#comment:1 CakePHP : The Rapid Development Framework for PHP https://trac.cakephp.org/ Cake is a rapid development framework for PHP which uses commonly known design patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups tickets cakephp group. To post to this group, send email to tickets-cakephp@googlegroups.com To unsubscribe from this group, send email to tickets-cakephp+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/tickets-cakephp?hl=en -~--~~~~--~~--~--~---