[UPHPU] Nested Classes?

William Attwood wattwood at gmail.com
Wed Apr 16 10:52:54 MDT 2008


So long as you inherit or instantiate your new objects within the scope of
your current object (Database) you should be fine.  Including files just
makes them available if you want to use them.

--Will

On Wed, Apr 16, 2008 at 10:42 AM, Nathan Lane <nathamberlane at gmail.com>
wrote:

> No, you're right - I realized that as I was typing it into PDT. I can't
> see
> any way to implement nested classes obviously right now. PHP.net doesn't
> supply any examples. I want to have classes I call adapters to communicate
> transparently between "queries" and "databases", and I'm starting at the
> database end. Anyway, so since I can't use nested classes, I just decided
> to
> structure everything a little bit differently:
>
> Database.php
>  -- require_once('exceptions/exceptions.php');
>    -- include('FunctionNotImplementedException.php');
>  -- require_once('adapters/adapters.php');
>    -- include('SqlAdapter.php');
>    -- include('XmlAdapter.php');
>
> Do I look like I'm starting well? I expect everything that is "include"d
> in
> the exceptions.php and adapters.php to be readily available to
> Database.php.
> Or is my understanding of inheritance incorrect?
>
> Nathan
>
> On Wed, Apr 16, 2008 at 10:36 AM, Roberto Mello <roberto.mello at gmail.com>
> wrote:
>
> > But the code posted by Craig doesn't give you a function pointer.
> > Database.xmlAdapter will just be an instance of XMLAdapter, not a
> > function pointer. Or were you referring to something else?
> >
> > Roberto
> >
>
> --
> Nathan Lane
> Home, http://www.nathandelane.com
> Blog, http://nathandelane.blogspot.com
>
> _______________________________________________
>
> UPHPU mailing list
> UPHPU at uphpu.org
> http://uphpu.org/mailman/listinfo/uphpu
> IRC: #uphpu on irc.freenode.net
>


More information about the UPHPU mailing list