Object problem
| From: | Mathieu Dumoulin | Date: | Tue, 23 Jul 2002 19:04:06 +0000 |
| Subject: | Object problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-109130@lists.php.net to get a copy of this message | ||
I just wrote this message in the wrong list so i'll be short...
I have two classes:
- mysql_connection
- data_collection
data_collection REQUIRES a mysql_connection object to work. So i decided to
pass this object in the constructor for the data_collection, but when i do
so it seems it creates a copy of this object and doesn't use the object i
had previously created...
I tried to do function data_collection(&$mysql_server){
...
}
But even the & sign like they say to use on the php.net web site doesn't
work, it creates a copy of the object. The only way i found to bypass this
problem is to do:
my_collection->mysql_server = &$mysql_server;
which will assign a reference of the mysql_collection object to my
collection, but this means i need to modify something like 45 files of my
web site and also i have to add some init settings because they where done
in the constructor where you needed the connection...
please help me out!!!
InsaneCoder