1Padre::DB::HostConfig(3U)ser Contributed Perl DocumentatiPoandre::DB::HostConfig(3)
2
3
4

NAME

6       Padre::DB::HostConfig - Padre::DB class for the "hostconf" table
7

SYNOPSIS

9       TO BE COMPLETED
10

DESCRIPTION

12       TO BE COMPLETED
13

METHODS

15   select
16         # Get all objects in list context
17         my @list = Padre::DB::HostConfig->select;
18
19         # Get a subset of objects in scalar context
20         my $array_ref = Padre::DB::HostConfig->select(
21             'where name > ? order by name',
22             1000,
23         );
24
25       The "select" method executes a typical SQL "SELECT" query on the
26       "hostconf" table.
27
28       It takes an optional argument of a SQL phrase to be added after the
29       "FROM hostconf" section of the query, followed by variables to be bound
30       to the placeholders in the SQL phrase. Any SQL that is compatible with
31       SQLite can be used in the parameter.
32
33       Returns a list of "Padre::DB::HostConfig" objects when called in list
34       context, or a reference to an ARRAY of "Padre::DB::HostConfig" objects
35       when called in scalar context.
36
37       Throws an exception on error, typically directly from the DBI layer.
38
39   count
40         # How many objects are in the table
41         my $rows = Padre::DB::HostConfig->count;
42
43         # How many objects
44         my $small = Padre::DB::HostConfig->count(
45             'where name > ?',
46             1000,
47         );
48
49       The "count" method executes a "SELECT COUNT(*)" query on the "hostconf"
50       table.
51
52       It takes an optional argument of a SQL phrase to be added after the
53       "FROM hostconf" section of the query, followed by variables to be bound
54       to the placeholders in the SQL phrase. Any SQL that is compatible with
55       SQLite can be used in the parameter.
56
57       Returns the number of objects that match the condition.
58
59       Throws an exception on error, typically directly from the DBI layer.
60
61   new
62       TO BE COMPLETED
63
64       The "new" constructor is used to create a new abstract object that is
65       not (yet) written to the database.
66
67       Returns a new "Padre::DB::HostConfig" object.
68
69   create
70         my $object = Padre::DB::HostConfig->create(
71
72             name => 'value',
73
74             value => 'value',
75
76         );
77
78       The "create" constructor is a one-step combination of "new" and
79       "insert" that takes the column parameters, creates a new
80       "Padre::DB::HostConfig" object, inserts the appropriate row into the
81       "hostconf" table, and then returns the object.
82
83       If the primary key column "name" is not provided to the constructor (or
84       it is false) the object returned will have "name" set to the new unique
85       identifier.
86
87       Returns a new "hostconf" object, or throws an exception on error,
88       typically from the DBI layer.
89
90   insert
91         $object->insert;
92
93       The "insert" method commits a new object (created with the "new"
94       method) into the database.
95
96       If a the primary key column "name" is not provided to the constructor
97       (or it is false) the object returned will have "name" set to the new
98       unique identifier.
99
100       Returns the object itself as a convenience, or throws an exception on
101       error, typically from the DBI layer.
102
103   delete
104         # Delete a single instantiated object
105         $object->delete;
106
107         # Delete multiple rows from the hostconf table
108         Padre::DB::HostConfig->delete('where name > ?', 1000);
109
110       The "delete" method can be used in a class form and an instance form.
111
112       When used on an existing "Padre::DB::HostConfig" instance, the "delete"
113       method removes that specific instance from the "hostconf", leaving the
114       object intact for you to deal with post-delete actions as you wish.
115
116       When used as a class method, it takes a compulsory argument of a SQL
117       phrase to be added after the "DELETE FROM hostconf" section of the
118       query, followed by variables to be bound to the placeholders in the SQL
119       phrase. Any SQL that is compatible with SQLite can be used in the
120       parameter.
121
122       Returns true on success or throws an exception on error, or if you
123       attempt to call delete without a SQL condition phrase.
124
125   truncate
126         # Delete all records in the hostconf table
127         Padre::DB::HostConfig->truncate;
128
129       To prevent the common and extremely dangerous error case where deletion
130       is called accidentally without providing a condition, the use of the
131       "delete" method without a specific condition is forbidden.
132
133       Instead, the distinct method "truncate" is provided to delete all
134       records in a table with specific intent.
135
136       Returns true, or throws an exception on error.
137

INTERFACE

139   Accessors
140       name
141
142         if ( $object->name ) {
143             print "Object has been inserted\n";
144         } else {
145             print "Object has not been inserted\n";
146         }
147
148       Returns true, or throws an exception on error.
149
150         REMAINING ACCESSORS TO BE COMPLETED
151
152   SQL
153       The "hostconf" table was originally created with the following SQL
154       command.
155
156         CREATE TABLE hostconf (
157               name VARCHAR(255) PRIMARY KEY,
158               value VARCHAR(255)
159         )
160

SUPPORT

162       "Padre::DB::HostConfig" is part of the Padre::DB API.
163
164       See the documentation for Padre::DB for more information.
165

AUTHOR

167       Adam Kennedy
168
170       Copyright 2008-2010 The Padre development team as listed in Padre.pm.
171
172       This program is free software; you can redistribute it and/or modify it
173       under the same terms as Perl itself.
174
175       The full text of the license can be found in the LICENSE file included
176       with this module.
177
178
179
180perl v5.12.1                      2010-06-11          Padre::DB::HostConfig(3)
Impressum