Hi all,

I understand that you can call the parent function
from within an overriding child function using the
parent::method syntax. That's OK. 

My problem is...I need the parent's data! (I know 
that the class has no data, only objects of that 
class have data, etc etc.)

I have a class that can execute SQL statements. It
is extended into many different classes that add 
extra functionality - no rocket science.

What I want to do is add permission checking in 
the child classes that then call the same function
in the parent *object. ie:

Class A { 
    function save() { 
        //refer to member data...
        //execute sql based on member data... 
    } 
}

Class B extends A {
    function save() {
        //check current user rights

      //if ok, execute parent::save()
      //BUT parent::save() won't have
      //access to the member data it 
        //needs because it is a static call.
    }
}

Any ideas? I have a feeling it could be achieved with
the serialize funtion, as I saw in the annotated manual,
but I don't quite understand what is going on in the
example. (I assume it is hacking the object's internal
representation so that it refers to a different class.
Scary.)

Thanks for any help

Regards, 

Tyson Lloyd Thwaites
IT&e Limited
e-Commerce Division
Adelaide
(08) 8346 3888

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to