DBIx::DataModel::Meta::Utils - Utility methods for DBIx::DataModel metaclasses
DBIx::DataModel::Meta::Utils->define_class( name => $class_name, isa => \@parents, metadm => $meta_instance, ); DBIx::DataModel::Meta::Utils->define_method( class => $class_name, name => $method_name, body => $method_body, check_override => $toggle, ); DBIx::DataModel::Meta::Utils->define_readonly_accessors( $class_name => @accessor_names );
A few utility methods for convenience of other DBIx::DataModel::Meta::* subclasses.
DBIx::DataModel::Meta::*
DBIx::DataModel::Meta::Utils->define_class( name => $class_name, isa => \@parents, metadm => $meta_instance, );
Creates a Perl class of the given name, that inherits from classes specified in @parents, and injects into that class a metadm accessor method that will return the given $meta_instance.
@parents
metadm
$meta_instance
DBIx::DataModel::Meta::Utils->define_method( class => $class_name, name => $method_name, body => $method_body, check_override => $toggle, );
Creates a method $method_name within class $class_name, with $method_body as implementation. If $check_override is true, a warning is issued if the method name conflicts with an inherited method in that class.
$method_name
$class_name
$method_body
$check_override
DBIx::DataModel::Meta::Utils->define_readonly_accessors( $class_name => @accessor_names );
Creates a collection of accessor methods within $class_name. Each accessor method returns the value stored in %$self under the same name, i.e. accessor foo returns $self->{foo}. However, if that value is a hashref or arrayref, a shallow copy is returned : for example if $self->{foo} is an arrayref, then the accessor method returns @{$self->{foo}}.
%$self
foo
$self->{foo}
@{$self->{foo}}
To install DBIx::DataModel, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::DataModel
CPAN shell
perl -MCPAN -e shell install DBIx::DataModel
For more information on module installation, please visit the detailed CPAN module installation guide.