Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ropkg::simba::exclude(3pm) [debian man page]

RoPkg::Simba::Exclude(3pm)				User Contributed Perl Documentation				RoPkg::Simba::Exclude(3pm)

NAME
RoPkg::Simba::Exclude VERSION
0.1.2 DESCRIPTION
RoPkg::Simba::Exclude is the class used by simba to manipulate a exclude list. It has the basic sql methods (inherited from RoPkg::DBObject). SYNOPSIS
!#/usr/bin/perl use RoPkg::DB; use RoPkg::Simba::Exclude; sub main { my $dbp = new RoPkg::DB(); $dbp->Add('dbi:mysql:database=mysql;host=localhost', 'root', '', 'local'); my $c = new RoPkg::Simba::Exclude(db => $dbp, db_method => 'db_local'); $c->id(1); $c->Load(); } main(); SUBROUTINES
/METHODS All methods (besides new) raise OutsideClass exception when called outside class instance. Also, some methods may rise diferent exceptions. Please read the section in which the method is described to find out more information about exceptions. new() The class constructor. At this moment, it just calls RoPkg::DBObject->new() . Please read the RoPkg::DBObject manual page for more information about the new() parameters. table() Returns the name of the exclude lists database table. ExList() get/set the excluded items. When set behaviour is selected, the exclude list must be passed to the method. The exclude list must be set before adding the new exclude list to database. AddItems(@new_items) Add @new_items to the list of excluded items and returns the new number of excluded items. GetItems() Returns the list of excluded items. In scalar context returns the number of excluded items The following methods are get/set methods for all fields of a mirror. *) id *) MirrorID *) CommandID Add() Adds the mirror to the database. This method is a wrapper for RoPkg::DBObject::SQL_Insert . On success 0 is returned. On error, DBI exception is raised. Delete() Deletes the current exclude list from the database. Before calling this method, you should set the id of the exclude list . If you don't set the id Param::Missing exception is raised. On database operation success, 0 is returned. On database error, DBI exception is raised. Update() Update the current exclude list object with the database. Before calling this method, you should set the id of the exclude list . If you don't set the id Param::Missing exception is raised. On database operation success, 0 is returned. On database error, DBI exception is raised. Load() Load the exclude list from the database, into the current object. Before calling this method you should have set id or MirrorID and CommandID. If none are found, then Param::Missing is raised. On database operation success 0 is returned. On database error, DBI exception is raised. DIAGNOSTICS
Unpack the source, and use 'make test' command CONFIGURATION AND ENVIRONMENT
This module does not use any configuration files or environment variables. DEPENDENCIES
RoPkg::DBObject and RoPkg::Exceptions INCOMPATIBILITIES
None known to the author BUGS AND LIMITATIONS
None known to the author PERL CRITIC
This module is perl critic level 2 compliant (with 1 exception) SEE ALSO
RoPkg::Simba::Excludes RoPkg::Exceptions RoPkg::Object AUTHOR
Subredu Manuel <diablo@iasi.roedu.net> LICENSE AND COPYRIGHT
Copyright (C) 2005 Subredu Manuel. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license. perl v5.14.2 2006-07-04 RoPkg::Simba::Exclude(3pm)

Check Out this Related Man Page

RoPkg::DBCollection(3pm)				User Contributed Perl Documentation				  RoPkg::DBCollection(3pm)

NAME
RoPkg::DBCollection - base class who can be used for collections of database objects VERSION
0.1.3 DESCRIPTION
RoPkg::DBCollection is a class who can be used as a base class for database collection of objects. Is used by RoPkg::Simba::Mirrors ,RoPkg::Simba::Commands and RoPkg::Simba::Excludes. This class should not be used directly in applications but derived. SUBROUTINES
/METHODS new() The class constructor. Accepts a hash with parameters. The parameters who can be passed to new() are: dbo - database object (instance of RoPkg::DB) dbo_method - database method (for use with RoPkg::DB) table - the sql table name where the objects data can be found If you don't specify the dbo and dbo_method parameters, a Param::Missing exception is raised. dbh() returns the database handler (DBI object) used by the class. _count($fields) Returns the number of records who match the fields specified in $fields. This method should be overriden by the child classes. The $fields must me specified in SQL::Abstract format. Please refer to the SQL::Abstract documentation for more details about $fields format. _get($class_name, $fields, $order_by) Returns a array of initialized objects. The values are read from the database. $class_name is the name of the class who's gonna be instan- ciated. When creating the class instance dbo and dbo_method parameters are passed to the new() method. The records from the database must match the $fields parameter and the order is given by $order_by. For more details of these 2 parameters please refer to SQL::Abstract docu- mentation. Exceptions throwed: Param::Missing - when $class_name has not been specified Param::Wrong - when $class_name is not a class name DB::NoResults - when the query returned 0 results SYNOPSIS
package RoPkg::Tester; use strict; use warnings; use Scalar::Util qw(blessed); use RoPkg::Exceptions; use RoPkg::DBCollection; use vars qw(@ISA); @ISA=qw(RoPkg::DBCollection); sub new { my ($class, %opt) = @_; my $self; $self = $class->SUPER::new(%opt); $self->{table} = 'Mirrors'; return $self; } sub Count { my ($self) = @_; if (!blessed($self)) { OutsideClass->throw( error => 'Called outside class instance', pkg_name => 'RoPkg::Tester', ); } return $self->_count(); } sub Get { my ($self, $fields) = @_; if (!blessed($self)) { OutsideClass->throw( error => 'Called outside class instance', pkg_name => 'RoPkg::Tester' ); } return $self->_get('RoPkg::Simba::Mirror'); } 1; sub main { my ($dbc, $dbp); $dbp = new RoPkg::DB(); $dbp->Add( 'dbi:mysql:database=mirrors_db;host=localhost', 'root', '', 'mirrors' ); $dbc = new RoPkg::Tester( dbo => $dbp, dbo_method => 'db_mirrors' ); print $dbc->Count(),$/; my @mirrors = $dbc->Get(); } main(); DIAGNOSTICS
This module comes with tests. To run them, unpack the source and use 'make test' command. PERL CRITIC
This modules is perlcritic level 2 compliant (with 1 exception) CONFIGURATION AND ENVIRONMENT
This module does not use any configuration files or environment variables. However, it is possible that some dependencies to do so. Please read the man page of each dependency to find out more information. DEPENDENCIES
This module use the following modules: *) SQL::Abstract *) DBI *) Scalar::Util *) RoPkg INCOMPATIBILITIES
None known to the author BUGS AND LIMITATIONS
None known to the author SEE ALSO
RoPkg::Exceptions RoPkg::DB RoPkg::DBObject RoPkg::Simba::Mirrors AUTHOR
Subredu Manuel <diablo@iasi.roedu.net> LICENSE AND COPYRIGHT
Copyright (C) 2006 Subredu Manuel. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license. perl v5.8.8 2006-06-09 RoPkg::DBCollection(3pm)
Man Page