AsForm and accessor names
[prev]
[thread]
[next]
[Date index for 2004/12/21]
Class::DBI::AsForm assumes that every column has an accessor with the
same name. This is not true if accessors have been renamed using
Class::DBI's accessor_name method. The result is an ugly death in the
_to_*** functions when they invoke $self->$col.
To fix this, I believe code is needed in to_field along these lines:
my $accessor = $class->can('accessor_name')
? $class->accessor_name($field)
: $field;
$accessor then needs to be passed to each _to_*** function and
$self->$col needs changing to $self->$accessor everywhere.
This breaks backward compatibility in the _to_*** call interfaces (why
are they exported into my namespace anyway?) so I imagine there might be
other opinions.
Cheers, Dave
|
AsForm and accessor names
Dave Howorth 15:09 on 21 Dec 2004
|