The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

  Class::ReluctantORM::Base - Class building helper

SYNOPSIS

  package Person;
  use base 'Class::ReluctantORM::Base';

  __PACKAGE__->build_class(
    fields => [ qw(person_id name birthdate) ],
    ro_fields => [ qw(person_id) ],

    # See Class::ReluctantORM
  );

  # Now you have...
  package main;
  my $p = Person->new(name => 'SuchAndSuch', birthdate => '2008-01-12');
  print $p->name . " was born on " . $p->birthdate() . "\n";
  $p->name('WhatsTheirFace');

  $p->person_id(123); # Kaboom, person_id is readonly

DESCRIPTION

Provides class-building facilities for Class::ReluctantORM, including defining accessors and mutators.

SEE ALSO

Class::ReluctantORM, which leverages this class heavily.

PUBLIC CLASS METHODS

$class->build_class(%args);

Sets up $class to have the accessors and mutators given.

Extra parameters are ignored.

fields

An array ref of field names, which will be used to create accessors, and if not listed in ro_fields, also mutators.

ro_fields

An array ref of field names, which will be restricted to be read-only.

@field_names = $class->field_names();

Returns a list of the field names for the given class.

AUTHOR

  Clinton Wolfe