Re: set_sql with __TABLE__ and multi-level inheritance
[prev]
[thread]
[next]
[Date index for 2005/03/27]
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