Quantcast

stored procedures cakephp

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

stored procedures cakephp

Milina Udara
I found that we can use SP with Cakephp. But there are thing  call    transaction,   DataSource,   behaviors and  Events System. 
My  problem is  where to use those things and SP ?
 I wont answer from architectural  view.


--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
[hidden email] For more options, visit this group at http://groups.google.com/group/cake-php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: stored procedures cakephp

Борислав Събев
The best place would be in a separate function in the applicable Model. To wrap the procedure call in a transaction do something like:
For example if you have a calcUserRep() procedure you should do:

public function getUserRep($someParam,$someOtherParam){
......
$this->begin();
$this
->query("CALL calcUserRep();");
$result
= $this->query("SELECT something");
$this
->commit();
....
}

On Thursday, 2 August 2012 13:27:57 UTC+3, Milina Udara wrote:
I found that we can use SP with Cakephp. But there are thing  call    transaction,   DataSource,   behaviors and  Events System. 
My  problem is  where to use those things and SP ?
 I wont answer from architectural  view.


--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
[hidden email] For more options, visit this group at http://groups.google.com/group/cake-php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: stored procedures cakephp

abhijit kakade
Hi Борислав Събев,

I was facing same kind of  problem so i used PEAR:DB  library inside cake venor folder, pear has very good functions to call store procedures ..

Thanks,
Abhijit

On Fri, Aug 3, 2012 at 2:04 PM, Борислав Събев <[hidden email]> wrote:
The best place would be in a separate function in the applicable Model. To wrap the procedure call in a transaction do something like:
For example if you have a calcUserRep() procedure you should do:

public function getUserRep($someParam,$someOtherParam){
......
$this->begin();
$this
->query("CALL calcUserRep();");
$result
= $this->query("SELECT something");
$this
->commit();
....
}

On Thursday, 2 August 2012 13:27:57 UTC+3, Milina Udara wrote:
I found that we can use SP with Cakephp. But there are thing  call    transaction,   DataSource,   behaviors and  Events System. 
My  problem is  where to use those things and SP ?
 I wont answer from architectural  view.


--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
[hidden email] For more options, visit this group at http://groups.google.com/group/cake-php



--
Abhijit Kakade
LAMP Developer,
MCP,CCNA
Mob : +91-9923729250

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
[hidden email] For more options, visit this group at http://groups.google.com/group/cake-php
Loading...