Fey::Object::Policy - An object representing a specific policy


Fey-ORM documentation  | view source Contained in the Fey-ORM distribution.

Index


NAME

Top

Fey::Object::Policy - An object representing a specific policy

VERSION

Top

version 0.43

DESCRIPTION

Top

This class provides the non-sugar half of Fey::ORM::Policy. It's probably not interesting unless you're interested in the guts of how Fey::ORM works.

METHODS

Top

This class accepts the following methods:

$policy->add_transform( matching => sub { ... }, inflate => sub { ... }, deflate => sub { ... } )

Stores a transform as declared in Fey::ORM::Policy

$policy->transform_for_column($column)

Given a Fey::Column, returns the first transform (as a hash reference) for which the matching sub returns true.

$policy->transforms()

Returns all of the transforms for the policy.

$policy->has_one_namer()

Returns the naming sub for has_one() methods. Defaults to:

  sub { lc $_[0]->name() }

$policy->set_has_one_namer($sub)

Sets the naming sub for has_one() methods.

$policy->has_many_namer()

Returns the naming sub for has_many() methods. Defaults to:

  sub { lc $_[0]->name() }

$policy->set_has_many_namer($sub)

Sets the naming sub for has_many() methods.

AUTHOR

Top

Dave Rolsky <autarch@urth.org>

COPYRIGHT AND LICENSE

Top


Fey-ORM documentation  | view source Contained in the Fey-ORM distribution.