Re: [CDBI] Connection with a fixed "where" clause.
[prev]
[thread]
[next]
[Date index for 2005/08/23]
On 22 Aug 2005, at 08:36, Karl.Moens@xxxxx.xxx wrote:
>
> Hi ListMembers,
>
> Is it possible to have a class with a fixed "where" clause?
yes...
> I was thinking of the following situation. I have a big database
> with a lot of customer related info (let's say ordering info). I
> would like to have one Catalyst application to access this
> database, but depending on who is using it, they should only be
> able to see the records of one customer only.
...but it's a bad solution, in my opinion. What you're talking about
here is a method, or a set of methods, in the Customer class. It's
not a change to the system-wide search and retrieval mechanisms. All
you need to do is call $customer->orders instead of calling Orders-
>retrieve_all.
> All I would have to do is to switch to another Model-class if the
> customer changes. The way Catalyst works it would be transparent
> for the rest of the application.
That sounds like a red flag, to me. I don't know catalyst at all, but
shouldn't you be changing your view here, not your model?
will
_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
|
|
Re: [CDBI] Connection with a fixed "where" clause.
William Ross 00:16 on 23 Aug 2005
|