#6439: Undefined behaviour in afterFind() if $primary is false
-----------------------------------+----------------------------------------
    Reporter:  pv47                |         Owner:           
        Type:  Test Case           |        Status:  new      
    Priority:  Medium              |     Milestone:  1.2.x.x  
   Component:  Core Libs           |       Version:  1.2 Final
    Severity:  Normal              |    Resolution:           
    Keywords:  afterFind $private  |   Php_version:  PHP 5    
Cake_version:  1.2.3.8166          |  
-----------------------------------+----------------------------------------
Comment (by pv47):

 First, I do understand that in real code false (according to the
 documentation) should be used as the default value of $primary.

 The non-boolean value is used here for two purposes:
 1. Using non-boolean value is the only possible way to distinguish between
 two formats currently (that's why I've posted the ticket).
 2. Using non-boolean value helps to determine if $primary was set
 explicitly when calling afterFind() (in this case it will be boolean false
 or true) or if afterFind() was called using the default $primary value. If
 $primary defaults to a boolean value (for example, false) in the test, you
 won't be able to determine if $primary was set to false explicitly when
 afterFind() is called, or if the "default" was used. IOW, with such a test
 case it's IMHO easier to debug (for example, using pr() in afterFind()).

-- 
Ticket URL: <https://trac.cakephp.org/ticket/6439#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
-~----------~----~----~----~------~----~------~--~---

Reply via email to