App::Dochazka::REST::Model::Shared - functions shared by several modules within the data model
Version 0.125
use App::Dochazka::REST::Model::Shared; ...
This module provides the following exports:
cud (Create, Update, Delete -- for single-record statements only)
cud
noof (get total number of records in a data model table)
noof
priv_by_eid
schedule_by_eid
** USE FOR SINGLE-RECORD SQL STATEMENTS ONLY ** Attempts to Create, Update, or Delete a single database record. Takes a blessed reference (activity object or employee object), a SQL statement, and a list of attributes. Overwrites attributes in the object with the RETURNING list values received from the database. Returns a status object. Call example:
$status = cud( $self, $sql, @attr );
Given a database handle and the name of a data model table, returns the total number of records in the table.
activities employees intervals locks privhistory schedhistory schedintvls schedules
On failure, returns undef.
Given a database handle, an EID, and, optionally, a timestamp, returns the employee's priv level as of that timestamp, or as of "now" if no timestamp was given. The priv level will default to 'passerby' if it can't be determined from the database.
Given a database handle, an EID, and, optionally, a timestamp, returns the employee's schedule as of that timestamp, or as of "now" if no timestamp was given. The schedule will default to '{}' if it can't be determined from the database.
Function that 'priv_by_eid' and 'schedule_by_eid' are wrappers of.
Returns a ready-made 'spawn' method.
Given a list of attributes, returns a ready-made 'reset' method.
Nathan Cutler, <presnypreklad@gmail.com>
<presnypreklad@gmail.com>
To install App::Dochazka::REST, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Dochazka::REST
CPAN shell
perl -MCPAN -e shell install App::Dochazka::REST
For more information on module installation, please visit the detailed CPAN module installation guide.