Dave Rolsky > Fey > Fey::Table::Alias

Download:
Fey-0.40.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  3
Open  2
View/Report Bugs
Module Version: 0.40   Source  

NAME ^

Fey::Table::Alias - Represents an alias for a table

VERSION ^

version 0.40

SYNOPSIS ^

  my $alias = $user_table->alias();

  my $alias = $user_table->alias( alias_name => 'User2' );

DESCRIPTION ^

This class represents an alias for a table. Table aliases allow you to join the same table more than once in a query, which makes certain types of queries simpler to express.

METHODS ^

This class provides the following methods:

Fey::Table::Alias->new()

This method constructs a new Fey::Table::Alias object. It takes the following parameters:

$alias->table()

Returns the Fey::Table object for which this object is an alias.

$alias->alias_name()

Returns the name for this alias.

$alias->name()

$alias->schema()

These methods work like the corresponding methods in Fey::Table. The name() method returns the real table name.

$alias->column($name)

$alias->columns()

$alias->columns(@names)

$alias->primary_key()

These methods work like the corresponding methods in Fey::Table. However, the columns they return will return the alias object when $column->table() is called.

$alias->is_alias()

Always returns true.

$alias->sql_with_alias()

Returns the appropriate SQL snippet for the alias.

$alias->id()

Returns a unique string identifying the alias.

ROLES ^

This class does the Fey::Role::TableLike and Fey::Role::Named roles.

BUGS ^

See Fey for details on how to report bugs.

AUTHOR ^

Dave Rolsky <autarch@urth.org>

COPYRIGHT AND LICENSE ^

This software is Copyright (c) 2011 by Dave Rolsky.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)
syntax highlighting: