Alzabo
view release on metacpan or search on metacpan
lib/Alzabo/Runtime/Column.pm view on Meta::CPAN
bless $clone, ref $self;
return $clone;
}
sub alias
{
my $self = shift;
my %p = validate( @_, { as => { type => SCALAR } } );
my $clone;
%$clone = %$self;
bless $clone, ref $self;
$clone->{alias_name} = $p{as};
$clone->{real_column} = $self;
return $clone;
}
sub alias_name
{
return $_[0]->{alias_name} || $_[0]->{name};
}
1;
__END__
=head1 NAME
Alzabo::Runtime::Column - Column objects
=head1 SYNOPSIS
use Alzabo::Runtime::Column;
=for pod_merge DESCRIPTION
=head1 INHERITS FROM
C<Alzabo::Column>
=for pod_merge merged
=for pod_merge METHODS
=head2 alias
Takes the following parameters:
=over 4
=item * as => $name
=back
This method returns an object that can be used in calls to the table
and schema C<select()> methods in order to change the name given to
the column if C<next_as_hash()> is called on the
L<C<Alzabo::DriverStatement>|Alzabo::Driver/Alzabo::DriverStatment>
returned by the aforementioned C<select()> method.
=head1 AUTHOR
Dave Rolsky, <autarch@urth.org>
=cut
( run in 0.960 second using v1.01-cache-2.11-cpan-ceb78f64989 )