DBIx-Class-Wrapper
view release on metacpan or search on metacpan
lib/DBIx/Class/Wrapper/Factory.pm view on Meta::CPAN
using the wrapper method.
See L<DBIx::Class::ResultSet/create>
=cut
sub create{
my ($self , $args) = @_;
return $self->wrap($self->dbic_rs->create($args));
}
=head2 find
Finds an object in the DBIC schema and returns it wrapped
using the wrapper method.
See L<DBIx::Class::ResultSet/find>
=cut
sub find{
my ($self , @rest) = @_;
my $original = $self->dbic_rs->find(@rest);
return $original ? $self->wrap($original) : undef;
}
=head2 first
Equivalent to DBIC Resultset 'first' method.
See <DBIx::Class::ResultSet/first>
=cut
sub first{
my ($self) = @_;
my $original = $self->dbic_rs->first();
return $original ? $self->wrap($original) : undef;
}
=head2 single
Equivalent to DBIx::Class::ResultSet::single. It's a bit more efficient than C<first()>.
=cut
sub single {
my ($self) = @_;
my $original = $self->dbic_rs->single();
return $original ? $self->wrap($original) : undef;
}
=head2 update_or_create
Wraps around the original DBIC update_or_create method.
See L<DBIx::Class::ResultSet/update_or_create>
=cut
sub update_or_create {
my ($self, $args) = @_;
my $original = $self->dbic_rs->update_or_create($args);
return $original ? $self->wrap($original) : undef;
}
=head2 find_or_create
Wraps around the original DBIC find_or_create method.
See L<DBIx::Class::ResultSet/find_or_create>
=cut
sub find_or_create{
my ($self , $args) = @_;
my $original = $self->dbic_rs->find_or_create($args);
return $original ? $self->wrap($original) : undef;
}
=head2 find_or_new
Wraps around the original DBIC find_or_new method.
See L<DBIx::Class::ResultSet/find_or_new>
=cut
sub find_or_new {
my ($self, @args) = @_;
return $self->wrap( $self->dbic_rs->find_or_new( @args ) );
}
=head2 pager
Shortcut to underlying dbic_rs pager.
See L<DBIx::Class::ResultSet/pager>.
=cut
sub pager{
my ($self) = @_;
return $self->dbic_rs->pager();
}
=head2 delete
Shortcut to L<DBIx::Class::ResultSet/delete>
=cut
sub delete{
my ($self , @rest) = @_;
return $self->dbic_rs->delete(@rest);
}
=head2 get_column
Shortcut to the get_column of the decorated dbic_rs
( run in 0.696 second using v1.01-cache-2.11-cpan-6aa56a78535 )