note 21600 added to ref.classobj
| From: | justin dot philpott at nmigroup dot com | Date: | Mon, 20 May 2002 20:41:21 +0000 |
| Subject: | note 21600 added to ref.classobj | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-30814@lists.php.net to get a copy of this message | ||
A problem concerning nested objects:
Now this may be obvious to some (if so please let me know!) but I have the two following statements:
// 1.
echo $ProfileRoom->queryobjects["ImageNames"]->GetNumRows();
// 2.
echo $ProfileRoom->GetQueryObj("ImageNames")->GetNumRows();
In each I tried a different way to access a member function (GetNumRows()) of a object that resides
within an associative array (queryobjects[]) which is itself a member variable of a parent object
($ProfileRoom).
As I expected, PHP doesn't like 2. (it chucked out a parse error), whereas 1. works fine.
My issue with this is that I'm tying to be true to OO principles and only access members via
get/set functions, as such, even though statement 1. works, I don't like it...
Can anyone show me a better way???
Thanks very much,
Justin
--
http://www.php.net/manual/en/ref.classobj.php
http://master.php.net/manage/user-notes.php?action=edit+21600
http://master.php.net/manage/user-notes.php?action=delete+21600
http://master.php.net/manage/user-notes.php?action=reject+21600