Parent and child class relationship problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mabus
Forum Newbie
Posts: 17
Joined: Wed Apr 16, 2008 11:52 pm

Parent and child class relationship problem

Post by mabus »

Hi guys. I'm a new member of this forum, and seems to me that it si quite promising.

Now, this would be my first post, and I'd like to share a bit of a problem.

Here's the situation...

I have two classes , one is a parent class, and the other is a child that extends to it. Now both classes have private memebers that are accessed via properties. Now, what I want to do is to iterate through the object, from the child class, and be able to get the members of the parent class too. How can I do this?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Parent and child class relationship problem

Post by Christopher »

(#10850)
mabus
Forum Newbie
Posts: 17
Joined: Wed Apr 16, 2008 11:52 pm

Re: Parent and child class relationship problem

Post by mabus »

hhmm..this one didn't seem to work for me. This function did not return anything, and I think I know the reason why.

In my object, all the members are private, and only accessed through properties. I guess what this functions does is to return just the members, if they are public, which is also the default on php.
Post Reply