[Dbix-class] howto define an aggregating function

Hartmaier Alexander Alexander.Hartmaier at t-systems.at
Mon Jan 29 21:26:06 GMT 2007


Hi!

Just define a normal class method:

sub get_address {
    my $self = shift;

    return $self->zip . ' ' . $self->city . ', ' . $self->street;
}

-Alex

> -----Original Message-----
> From: Mario Minati [mailto:mario at minati.de]
> Sent: Monday, January 29, 2007 7:46 PM
> To: dbix-class at lists.rawmode.org
> Subject: [Dbix-class] howto define an aggregating function
> 
> Hello @all,
> 
> I am useing DBIx:Class with Catalyst and would like to extend one of my
> modell classes (derived from DBIx::Class).
> 
> I would like to extand the class that handles address data (like street,
> zipcode and city) to provide a function that delivers me a concatenation
> of these value (returning  something like "street, zipcode city").
> How do I achieve this goal?
> 
> Thanks for any help,
> 
> Mario Minati
> 
> _______________________________________________
> List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> Wiki: http://dbix-class.shadowcatsystems.co.uk/
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
> Searchable Archive: http://www.mail-archive.com/dbix-
> class at lists.rawmode.org/

*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be privileged.
If you are not the intended recipient, please notify the sender and then delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*




More information about the Dbix-class mailing list