note 16076 deleted from language.oop by vincent
| From: | vincent@php.net | Date: | Thu, 11 Sep 2003 19:56:03 +0000 |
| Subject: | note 16076 deleted from language.oop by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56198@lists.php.net to get a copy of this message | ||
Note Submitter: dave@4-core.com
----
$class->propertyObject->method()
In case you're wondering, PHP 4 has no problem with chaining -> to refer to
properties/methods of objects which are themselves properties of other objects. E.g., I was setting
up a database class which wanted to know a couple of related records:
In the 'dbRecord' constructor: <br>
$this->child = new child_type($this->value("childFKey")); <br>
In the main code: <br>
$record = new parent; <br>
echo $record->child->childMethod(); <br>
...works just fine :-)
May be obvious to some, but it's not explicitly mentioned and I was a bit worried it
wouldn't work 'cause I really need it!
(I guess it follows from the same way you do $multiArray[][] to get at multidimensional array
indices.)