Hi all,

I have a table with numeric fields a en b. So the Resultsource declaration is

  __PACKAGE__->add_columns( 'a' => { is_numeric => 1 },
                            'b' => { is_numeric => 1 }, )

In the Resultsource class I want to add sub c as follows:

  sub c {
    my $self = shift;
    return $self->a + $self->b
  }

Now how can I use c as a column ? This is what I need:

  my $selection = $rs->search({}, { columns => [qw /a b c/] }) ;

which would return a,b,c for all rows in the table, keeping the function
c hidden behind the name of a column.

Any hints ?
-- 
erik colson

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to