I have an Object
(
[id] => 1
[parent_id] => 0
[result:Database:private] =>
[db:Database:private] => mysqli Object
(
[affected_rows] => 0
...
)
)
Obviously, the Object has inherited the 'db' and 'result' properties of the parent Database class.
unset($object->result) nor unset($object->result:Database) nor unset($object->result:Database:private) work.
How could I unset those properties when they are no longer needed (i.e. when the object properties are about to be output)?
Is it a generally a good idea to have a database object as an inherited property of other classes (extend one Database class with all other classes that use database connections)?