Actually, static calls aren't so static when they're calling a method which is
in the inheritance tree.
In other words, parent:: calls (assuming the subclass is instanciated) will
operate instanciated.
John
On Tue, 27 Feb 2001, Tyson Lloyd Thwaites wrote:
> 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
>
>
--
John Donagher
Application Engineer
Intacct Corp. - Powerful Accounting on the Web
408-395-0989
720 University Ave.
Los Gatos CA 95032
www.intacct.com
Public key available off http://www.keyserver.net
Key fingerprint = 4024 DF50 56EE 19A3 258A D628 22DE AD56 EEBE 8DDD
--
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]