| ORDB-CPAN-Mandriva documentation | Contained in the ORDB-CPAN-Mandriva distribution. |
ORDB::CPAN::Mandriva::Module - orlite for module table in database
version 1.100230
This class models the module table in the database. It can be used
either with class methods, or as objects mapping one row of the table.
The name of the module, eg ORDB::CPAN::Mandriva.
The version of the module (not the dist, nor the package). It may be null.
This is the CPAN distribution the module is part of, eg
ORDB-CPAN-Mandriva. It may be null.
This is the name of the package holding this module in Mandriva Linux
distribution. Chances are that it looks like perl-ORDB-CPAN-Mandriva.
# Get all objects in list context
my @list = ORDB::CPAN::Mandriva::Module->select;
# Get a subset of objects in scalar context
my $array_ref = ORDB::CPAN::Mandriva::Module->select(
'where pkgname = ? order by module',
'perl-ORDB-CPAN-Mandriva',
);
The select method executes a typical SQL SELECT query on the
module table.
It takes an optional argument of a SQL phrase to be added after the
FROM module section of the query, followed by variables to be bound
to the placeholders in the SQL phrase. Any SQL that is compatible with
SQLite can be used in the parameter.
Returns a list of ORDB::CPAN::Mandriva::Module objects when called in list context, or a reference to an ARRAY of ORDB::CPAN::Mandriva::Module objects when called in scalar context.
Throws an exception on error, typically directly from the DBI layer.
# How many objects are in the table
my $rows = ORDB::CPAN::Mandriva::Module->count;
# How many objects
my $small = ORDB::CPAN::Mandriva::Module->count(
'where pkgname = ?',
'perl-ORDB-CPAN-Mandriva',
);
The count method executes a SELECT COUNT(*) query on the
module table.
It takes an optional argument of a SQL phrase to be added after the
FROM module section of the query, followed by variables to be bound
to the placeholders in the SQL phrase. Any SQL that is compatible with
SQLite can be used in the parameter.
Returns the number of objects that match the condition.
Throws an exception on error, typically directly from the DBI layer.
The new constructor is used to create a new abstract object that
is not (yet) written to the database.
Returns a new ORDB::CPAN::Mandriva::Module object.
The insert method commits a new object (created with the new
method) into the database.
Returns the object itself as a convenience, or throws an exception on error, typically from the DBI layer.
# Delete a single instantiated object
$object->delete;
# Delete multiple rows from the module table
ORDB::CPAN::Mandriva::Module->delete(
'where pkgname = ?',
'perl-ORDB-CPAN-Mandriva'
);
The delete method can be used in a class form and an instance form.
When used on an existing ORDB::CPAN::Mandriva::Module instance,
the delete method removes that specific instance from the
module, leaving the object intact for you to deal with post-delete
actions as you wish.
When used as a class method, it takes a compulsory argument of a SQL
phrase to be added after the DELETE FROM module section of the query,
followed by variables to be bound to the placeholders in the SQL phrase.
Any SQL that is compatible with SQLite can be used in the parameter.
Returns true on success or throws an exception on error, or if you attempt to call delete without a SQL condition phrase.
# Delete all records in the module table
ORDB::CPAN::Mandriva::Module->truncate;
To prevent the common and extremely dangerous error case where deletion
is called accidentally without providing a condition, the use of the
delete method without a specific condition is forbidden.
Instead, the distinct method truncate is provided to delete all
records in a table with specific intent.
Returns true, or throws an exception on error.
The create constructor is a one-step combination of new and
insert that takes the column parameters, creates a new
ORDB::CPAN::Mandriva::Module object, inserts the appropriate row into
the module table, and then returns the object.
Returns a new Module object, or throws an exception on error, typically from the DBI layer.
Jerome Quelin
This software is copyright (c) 2010 by Jerome Quelin.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
| ORDB-CPAN-Mandriva documentation | Contained in the ORDB-CPAN-Mandriva distribution. |
# # This file is part of ORDB-CPAN-Mandriva # # This software is copyright (c) 2010 by Jerome Quelin. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use 5.008005; use strict; use warnings; package ORDB::CPAN::Mandriva::Module; our $VERSION = '1.100230'; # ABSTRACT: orlite for module table in database # -- attributes # -- methods autogenerated by orlite 1;
__END__