package Padre::DB::Bookmark;
# NOTE: This class is loaded automatically by Padre::DB, overlaying the
# code already auto-generated by Padre::DB. Do not load manually, as this
# module will not function standalone.
use 5.008;
use strict;
use warnings;
use Padre::Constant ();
our $VERSION = '0.96';
######################################################################
# General Methods
sub select_names {
Padre::DB->selectcol_arrayref('select name from bookmark order by name');
}
# Finds and returns a single element by name.
# NOTE: This is probably broken, since there can be many plugins with one name
sub fetch_name {
return ( $_[0]->select( 'where name = ?', $_[1] ) )[0];
}
######################################################################
# Portability Support
if (Padre::Constant::PORTABLE) {
require Padre::Portable;
*new = sub {
my $class = shift;
my %param = @_;
$param{file} = Padre::Portable::freeze( $param{file} );
$class->SUPER::new(%param);
}
if __PACKAGE__->can('new');
*file = sub {
Padre::Portable::thaw( shift->SUPER::file(@_) );
}
if __PACKAGE__->can('file');
*set = sub {
my $self = shift;
my $name = shift;
my $value = shift;
if ( $name and $name eq 'file' ) {
$value = Padre::Portable::freeze($value);
}
$self->SUPER::set( $name => $value );
}
if __PACKAGE__->can('set');
}
1;
__END__
=pod
=head1 NAME
Padre::DB::Bookmark - Padre::DB class for the bookmark table
=head1 SYNOPSIS
TO BE COMPLETED
=head1 DESCRIPTION
TO BE COMPLETED
=head1 METHODS
=head2 base
# Returns 'Padre::DB'
my $namespace = Padre::DB::Bookmark->base;
Normally you will only need to work directly with a table class,
and only with one ORLite package.
However, if for some reason you need to work with multiple ORLite packages
at the same time without hardcoding the root namespace all the time, you
can determine the root namespace from an object or table class with the
C method.
=head2 table
# Returns 'bookmark'
print Padre::DB::Bookmark->table;
While you should not need the name of table for any simple operations,
from time to time you may need it programatically. If you do need it,
you can use the C
method to get the table name.
=head2 load
my $object = Padre::DB::Bookmark->load( $id );
If your table has single column primary key, a C method will be
generated in the class. If there is no primary key, the method is not
created.
The C method provides a shortcut mechanism for fetching a single
object based on the value of the primary key. However it should only
be used for cases where your code trusts the record to already exists.
It returns a C object, or throws an exception if the
object does not exist.
=head2 select
# Get all objects in list context
my @list = Padre::DB::Bookmark->select;
# Get a subset of objects in scalar context
my $array_ref = Padre::DB::Bookmark->select(
'where id > ? order by id',
1000,
);
The C