class of objects created by mysqli_result->fetch_object
| From: | Stefan Reimers | Date: | Sat, 04 Feb 2006 15:39:27 +0000 |
| Subject: | class of objects created by mysqli_result->fetch_object | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-41171@lists.php.net to get a copy of this message | ||
Hi,
I fetched some data from my MySQL database into objects. These are of class stdClass.
Now I wonder about the sense of having objects without methods defined. In fact, I cannot benefit from any of the OO advantages (namely property protection, controlled method calls on class properties) unless I wrap the properties of these instances of stdClass to a custom class, right?
Is there any way to fetch MYSQL data to a suitable class other than stdClass - suitable in the sense of: the custom class has all properties which are fetched from db.
thx
Stefan