Wednesday, October 19, 2011

Re: Am i breaking MVC?

New model for this task is good way to go. Simple and clean. And
extendable easier in case if data import become more tricky then now.

On 19 окт, 21:52, Ernesto <e.fanz...@gmail.com> wrote:
> Hi all.
>
> i have a simple app wich uses 2 different DBs.
> The second DB is used just to import data on a daily basis, no writes.
>
> i have 2 options:
>
> 1 - switch DB on-the-fly in my Order::import function
>
> function import() {
> $this->useDbConfig = "external_db";
> $this->query("SELECT * FROM blah");
> $this->useDbConfig = "default";
> $this->saveAll(/* still to code */);
>
> }
>
> 2 - add a new Model called "Import" with a different useDbConfig.
>
> wich one is best in your opinion? i don't want to break MVC.

--
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
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate