Re: [PHP] OO Theory Question

2004-08-18 Thread Kevin Waterson
This one time, at band camp, Justin Patrin <[EMAIL PROTECTED]> wrote: > On Wed, 18 Aug 2004 11:03:47 -0300, Ricardo Cezar <[EMAIL PROTECTED]> wrote: > > Probably it's a dumb question, but I'm new to OO Programming, so... > > > > How can I store the instance of the class in the session > > >

Re: [PHP] OO Theory Question

2004-08-18 Thread Justin Patrin
On Wed, 18 Aug 2004 11:03:47 -0300, Ricardo Cezar <[EMAIL PROTECTED]> wrote: > Probably it's a dumb question, but I'm new to OO Programming, so... > > How can I store the instance of the class in the session > I answered this a long time ago in this thread. Did you not get my mail? > Thanks

Re: [PHP] OO Theory Question

2004-08-18 Thread Torsten Roehr
"Ricardo Cezar" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Probably it’s a dumb question, but I’m new to OO Programming, so... > > How can I store the instance of the class in the session > > Thanks, > Rics That's no different to storing any other variable into the session:

Re: [PHP] OO Theory Question

2004-08-18 Thread Ricardo Cezar
Probably it’s a dumb question, but I’m new to OO Programming, so... How can I store the instance of the class in the session Thanks, Rics "Thomas Goyne" <[EMAIL PROTECTED]> escreveu na mensagem news:[EMAIL PROTECTED] > On Tue, 17 Aug 2004 12:25:42 -0600, Jed R. Brubaker <[EMAIL PROTECTED]>

Re: [PHP] OO Theory Question

2004-08-17 Thread Thomas Goyne
On Tue, 17 Aug 2004 12:25:42 -0600, Jed R. Brubaker <[EMAIL PROTECTED]> wrote: The real reason for having the login class like this is to eliminate database calls. I thought I could have one session variable that said yo uwere logged in, but then the database calls would still have to be made

RE: [PHP] OO Theory Question

2004-08-17 Thread Jason Davidson
i think for the ease of use, 1 db call per page is minimal, especially sinse we are talking about some small fields here. THe db is local to the webserver, so really, whats the problem. Jason "Ed Lazor" <[EMAIL PROTECTED]> wrote: > > > -Original Message- > > I don't know - is it? > >

RE: [PHP] OO Theory Question

2004-08-17 Thread Ed Lazor
> -Original Message- > I don't know - is it? I would think so. It's optimized for speed on small data sets. Does anyone else have an opinion on this? -Ed > > > "Ed Lazor" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > -Original Message- > > > > The

Re: [PHP] OO Theory Question

2004-08-17 Thread Jed R. Brubaker
I don't know - is it? "Ed Lazor" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > -Original Message- > > > The real reason for having the login class like this is to eliminate > > > database calls. I thought I could have one session variable that said yo > > > uwere logged

RE: [PHP] OO Theory Question

2004-08-17 Thread Ed Lazor
> -Original Message- > > The real reason for having the login class like this is to eliminate > > database calls. I thought I could have one session variable that said yo > > uwere logged in, but then the database calls would still have to be made > on > > each page. Playing Devil's Advoca

Re: [PHP] OO Theory Question

2004-08-17 Thread Justin Patrin
On Tue, 17 Aug 2004 12:03:56 -0600, Jed R. Brubaker <[EMAIL PROTECTED]> wrote: > Hi all! I could use some perspective on a project that I am currently > working on. > > I am trying to utilize OO to make my PHP easier, but I keep running into > problems that revolve around the stateless nature of t

Re: [PHP] OO Theory Question

2004-08-17 Thread Curt Zirzow
* Thus wrote Jed R. Brubaker: > Hi all! I could use some perspective on a project that I am currently > working on. > > I am trying to utilize OO to make my PHP easier, but I keep running into > problems that revolve around the stateless nature of the web. > > Consider the following: I have a log

Re: [PHP] OO Theory Question

2004-08-17 Thread Jason Davidson
So dont make db call, pass appropriate vars thru session... i like to pass an array of data into my classes, so that there is no db call inside the constructor, this saves db calls tremendously at times. so you could pass an array into session called, UserData or whatever, and use that to constru

RE: [PHP] OO Theory Question

2004-08-17 Thread Michael Sims
Jed R. Brubaker wrote: > Consider the following: I have a login class that is instantiated at > the top of every page. It can log you in, check to see if you are > logged in, etc. This class has an assortment of class variables such > as userID, userType, etc. [...] > A solution is to set all of th

Re: [PHP] OO Theory Question

2004-08-17 Thread Jed R. Brubaker
The real reason for having the login class like this is to eliminate database calls. I thought I could have one session variable that said yo uwere logged in, but then the database calls would still have to be made on each page. Thanks for the idea - any others? "Jason Davidson" <[EMAIL PROTECTE

Re: [PHP] OO Theory Question

2004-08-17 Thread Jason Davidson
put something in your script like if($_SESSION['authed'] == true) $user = new User($_SESSION['userId']); or something similar. Jason "Jed R. Brubaker" <[EMAIL PROTECTED]> wrote: > > Hi all! I could use some perspective on a project that I am currently > working on. > > I am trying to u