| Fey documentation | Contained in the Fey distribution. |
Fey::Role::ColumnLike - A role for "column-like" behavior
version 0.40
use Moose; with 'Fey::Role::ColumnLike';
Class which do this role are "column-like" . This role aggregates several other roles for the Fey::Column and Fey::Column::Alias classes.
This role provides the following methods:
These methods all return true when the $column->table()
returns an object.
This class does the Fey::Role::Selectable,
Fey::Role::Comparable, Fey::Role::Groupable, and
Fey::Role::Orderable roles.
See Fey for details on how to report bugs.
Dave Rolsky <autarch@urth.org>
This software is Copyright (c) 2011 by Dave Rolsky.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
| Fey documentation | Contained in the Fey distribution. |
package Fey::Role::ColumnLike; BEGIN { $Fey::Role::ColumnLike::VERSION = '0.40'; } use strict; use warnings; use namespace::autoclean; use Moose::Role; # This seems weird, but basically we're saying that column-like things # do these four roles, but the implementation is different for # column-like things (than for example, selectable things). with( 'Fey::Role::Selectable' => { -excludes => 'is_selectable' }, 'Fey::Role::Comparable' => { -excludes => 'is_comparable' }, 'Fey::Role::Groupable' => { -excludes => 'is_groupable' }, 'Fey::Role::Orderable' => { -excludes => 'is_orderable' }, ); requires '_build_id', 'is_alias'; sub _containing_table_name_or_alias { my $t = $_[0]->table(); $t->is_alias() ? $t->alias_name() : $t->name(); } sub is_selectable { return $_[0]->table() ? 1 : 0 } sub is_comparable { return $_[0]->table() ? 1 : 0 } sub is_groupable { return $_[0]->table() ? 1 : 0 } sub is_orderable { return $_[0]->table() ? 1 : 0 } 1; # ABSTRACT: A role for "column-like" behavior
__END__