#6124: Default datasource in Model when useTable is false
-----------------------+----------------------------------------------------
    Reporter:  mrjazz  |         Owner:           
        Type:  Bug     |        Status:  reopened 
    Priority:  Medium  |     Milestone:  1.2.x.x  
   Component:  Model   |       Version:  1.2 Final
    Severity:  Normal  |    Resolution:           
    Keywords:          |   Php_version:  n/a      
Cake_version:          |  
-----------------------+----------------------------------------------------
Changes (by ModelClass):

  * status:  closed => reopened
  * resolution:  needmoreinfo =>

Comment:

 I'm having the same problem.  Here's a reproducible test case:

 {{{
 class Lock extends AppModel
 {
         var $name = 'Lock';
         var $useTable = false;

         function LockTables($tableNames)
         {
                 $command = 'LOCK TABLES '.implode(', ',$tableNames);
                 return $this->query($command);
         }

         function UnlockTables()
         {
                 $command = 'UNLOCK TABLES';
                 return $this->query($command);
         }
 }

 }}}

 Steps:[[BR]]
 1 Put the above code as a class in your Models directory.[[BR]]
 2 Create a controller and add 'Lock' to the $uses array and make an action
 that calls Lock->LockTables();[[BR]]
 3 Create an analogous controller test case in app/test/cases/controller
 that calls the action from step 2.[[BR]]
 [[BR]]
 The query will go to the default conn rather than to the expected
 test_suite conn.

-- 
Ticket URL: <https://trac.cakephp.org/ticket/6124#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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to