Re: To model or not to model

2008-09-25 Thread Rafael Bandeira aka rafaelbandeira3
> > Still thinks that executing queries is needed? > > Yes. Sometimes You have uncommon database design, and You can't > EFFECTIVELY receive data just by using standard, even magic, model Definetly correct, my sentence wasn't much happy. I meant for the cases he presented. Anyway, keep in mind th

Re: To model or not to model

2008-09-25 Thread Grzegorz Pawlik
> Still thinks that executing queries is needed? Yes. Sometimes You have uncommon database design, and You can't EFFECTIVELY receive data just by using standard, even magic, model functions. In that case you should create method in model that executes your custom query with inner, outer, left join

Re: To model or not to model

2008-09-24 Thread Rafael Bandeira aka rafaelbandeira3
> > Rule of thumb perhaps? :) > If you really mean it: Let's say rule of thumb isn't exactly a rule. Now, if you were being ironic: Yay right, that's the kind of rule that can be applied to a pattern! --~--~-~--~~~---~--~~ You received this message because you are

Re: To model or not to model

2008-09-24 Thread dr. Hannibal Lecter
On Wed, Sep 24, 2008 at 1:32 PM, Rafael Bandeira aka rafaelbandeira3 < [EMAIL PROTECTED]> wrote: > > First of all people: what Rule? Rule of thumb perhaps? :) -- Misanthropy unleashed: http://dsi.vozibrale.com/ --~--~-~--~~~---~--~~ You received this message be

Re: To model or not to model

2008-09-24 Thread forrestgump
Ohk...sry rafael...i did not read the entire thread On Sep 24, 5:17 pm, forrestgump <[EMAIL PROTECTED]> wrote: > I dont think i asked anything bout using queries..i just wanted to > know wht would be the best practice..but thnx for the info...will > avoid $this->Model->query() > > On Sep

Re: To model or not to model

2008-09-24 Thread forrestgump
I dont think i asked anything bout using queries..i just wanted to know wht would be the best practice..but thnx for the info...will avoid $this->Model->query() On Sep 24, 4:32 pm, Rafael Bandeira aka rafaelbandeira3 <[EMAIL PROTECTED]> wrote: > First of all people: what Rule? It's not ma

Re: To model or not to model

2008-09-24 Thread Rafael Bandeira aka rafaelbandeira3
First of all people: what Rule? It's not made of rules, it's a pattern to follow - but follow as you want. Second, no, it doesn't "break the Rule" it only makes your code uglier and hard to read - see above - but the thing is, why to use a hand made query when you can easily/prettier/"readablier"

Re: To model or not to model

2008-09-23 Thread forrestgump
Thanks for the info guys...really appreciate it @RichardAtHome.whoops i forgot to mention the model inbetween"typo"...thnx for pointing tht out Forrestgump On Sep 23, 2:54 pm, techiguy <[EMAIL PROTECTED]> wrote: > hi forrestgump, > > using $this->find() in controller doesn't voilate

Re: To model or not to model

2008-09-23 Thread techiguy
hi forrestgump, using $this->find() in controller doesn't voilate the MVC architecture even if you use $this->find('all') but i heared if you direct query in controller will violate the MVC rule i.e if you use $this->Model->query("select * from models"); the above query will violate the MVC ru

Re: To model or not to model

2008-09-23 Thread RichardAtHome
Also worth noting: A controller can have multiple Models. Which model would $this->find() use? On Sep 23, 12:28 pm, "dr. Hannibal Lecter" <[EMAIL PROTECTED]> wrote: > Well, calling find() in a controller is not a violation, but not "the > best practice" if overused. > > Of course, calling find()

Re: To model or not to model

2008-09-23 Thread dr. Hannibal Lecter
Well, calling find() in a controller is not a violation, but not "the best practice" if overused. Of course, calling find() from a controller is the fastest way to get your data, but usually, the find() call has other stuff around it, stuff that might be common to each call. The idea is to make "

To model or not to model

2008-09-23 Thread forrestgump
Hey guys, Considering the fact that CakePhp follows the MVC architecture, id like to know...y we dont make function calls such as $this- >find("where id=xyz") from function blocks typed out in Models rather than controllersim sure there is a logical reason to it...but someone asked me this qu