NAME
Fey::Meta::Class::Table - A metaclass for table classes
SYNOPSIS
package MyApp::User;
use Fey::ORM::Table;
print __PACKAGE__->meta()->ClassForTable($table);
DESCRIPTION
This is the metaclass for table classes. When you use Fey::ORM::Table in your class, it uses this class to do all the heavy lifting.
METHODS
This class provides the following methods:
Fey::Meta::Class::Table->ClassForTable( $table1, $table2 )
Given one or more Fey::Table objects, this method returns the name of the class which "has" that table, if any.
Fey::Meta::Class::Table->TableForClass($class)
Given a class, this method returns the Fey::Table object associated with that class, if any.
$meta->table()
Returns the Fey::Table for the metaclass's class.
$meta->add_has_one(%options)
Creates a new Fey::Meta::HasOne::ViaFK or Fey::Meta::HasOne::ViaSelect object and adds it to the metaclass. Internally, this will call attach_to_class()
on the HasOne
meta-object.
$meta->has_ones()
Returns a list of the Fey::Meta::HasOne objects added to this metaclass.
$meta->remove_has_one($name)
Removes the named HasOne
meta-object. Internally, this will call detach_from_class()
on the HasOne
meta-object.
$meta->add_has_many(%options)
Creates a new Fey::Meta::HasMany::ViaFK or Fey::Meta::HasMany::ViaSelect object and adds it to the metaclass. Internally, this will call attach_to_class()
on the HasMany
meta-object.
$meta->has_manies()
Returns a list of the Fey::Meta::HasMany objects added to this metaclass.
$meta->remove_has_many($name)
Removes the named HasMany
meta-object. Internally, this will call detach_from_class()
on the HasMany
meta-object.
$meta->has_inflator($name)
Returns a boolean indicating whether or not there is an inflator defined for the named column.
$meta->has_deflator($name)
Returns a boolean indicating whether or not there is an inflator defined for the named column.
$meta->make_immutable()
This class overrides Moose::Meta::Class->make_immutable()
in order to do its own optimizations for immutability.
AUTHOR
Dave Rolsky, <autarch@urth.org>
BUGS
See Fey::ORM for details.
COPYRIGHT & LICENSE
Copyright 2006-2009 Dave Rolsky, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module.