Re: set_sql with __TABLE__ and multi-level inheritance

[prev] [thread] [next] [Date index for 2005/03/27]

From: Thomas L Shinnick
Subject: Re: set_sql with __TABLE__ and multi-level inheritance
Date: 22:23 on 27 Mar 2005
At 04:13 3/27/2005, Tony Bowden wrote:
>On Sat, Mar 26, 2005 at 08:22:16PM -0600, Thomas L. Shinnick wrote:
>> But if the set_sql() call was from MyCDBI, then won't there be only one
>> such named method, MyCBDI::sql_deleteAllRecords(), and then the __TABLE__
>> value is permanently set by the first use of the method?
>
>No. This is exactly what __TABLE__ etc are for - writing your SQL in a
>generic enough way to work no matter which class they're called from.
>It's perfectly safe. All the SQL inside Class::DBI itself works this way
>too.

Ahh, I see now.  The calls to transform_sql() are always relative to the subclass referenced at the time of the _call_, thus all info is from the subclass' point of view.  Thank you.


>Tony


set_sql with __TABLE__ and multi-level inheritance
Thomas L. Shinnick 02:22 on 27 Mar 2005

Re: set_sql with __TABLE__ and multi-level inheritance
Thomas L Shinnick 22:23 on 27 Mar 2005

Generated at 14:42 on 11 Apr 2005 by mariachi v0.52