Politics::AU::Geo::Polygons - Politics::AU::Geo class for the polygons table
TO BE COMPLETED
# Get all objects in list context my @list = Politics::AU::Geo::Polygons->select; # Get a subset of objects in scalar context my $array_ref = Politics::AU::Geo::Polygons->select( 'where pid > ? order by pid', 1000, );
The select method executes a typical SQL SELECT query on the polygons table.
select
SELECT
It takes an optional argument of a SQL phrase to be added after the FROM polygons 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.
FROM polygons
Returns a list of Politics::AU::Geo::Polygons objects when called in list context, or a reference to an ARRAY of Politics::AU::Geo::Polygons 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 = Politics::AU::Geo::Polygons->count; # How many objects my $small = Politics::AU::Geo::Polygons->count( 'where pid > ?', 1000, );
The count method executes a SELECT COUNT(*) query on the polygons table.
count
SELECT COUNT(*)
Returns the number of objects that match the condition.
if ( $object->pid ) { print "Object has been inserted\n"; } else { print "Object has not been inserted\n"; }
Returns true, or throws an exception on error.
REMAINING ACCESSORS TO BE COMPLETED
The polygons table was originally created with the following SQL command.
CREATE TABLE polygons ( pid INTEGER PRIMARY KEY, eid INTEGER NOT NULL, points BLOB NOT NULL, CONSTRAINT eid_fk FOREIGN KEY(eid) REFERENCES Electorates(eid) ON UPDATE CASCADE ON DELETE RESTRICT )
Politics::AU::Geo::Polygons is part of the Politics::AU::Geo API.
See the documentation for Politics::AU::Geo for more information.
Jeffery Candiloro <jeffery@cpan.org>
Adam Kennedy <adamk@cpan.org>
Copyright 2009 Jeffery Candiloro.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
To install Politics::AU::Geo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Politics::AU::Geo
CPAN shell
perl -MCPAN -e shell install Politics::AU::Geo
For more information on module installation, please visit the detailed CPAN module installation guide.