Is it possible to create a custom accessor/mutator for a column? For example, using the products table from the Object tutorial, I want to create my own name function so that I can code
and it will call my name function.
package Product;
use strict;
use base 'My::DB::Object';
__PACKAGE__->meta->setup
(
table => 'products',
columns =>
[
id => { type => 'integer', not_null => 1 },
name => { type => 'varchar', length => 255, not_null => 1 },
...
],
primary_key_columns => [ 'id' ],
unique_keys => [ 'name' ],
allow_inline_column_values => 1,
);
1;