This shows you the differences between two versions of the page.
esmith:db:record [2015/05/22 07:41] stephdl |
esmith:db:record [2019/06/05 19:48] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== esmith:: | ||
- | esmith:: | ||
- | In a root terminal you can do the command below if you want to display the up-to-date content | ||
- | | ||
- | ===== SYNOPSIS ===== | ||
- | DO NOT USE THIS CLASS DIRECTLY! | ||
- | |||
- | my $key = $record-> | ||
- | | ||
- | my %properties = $record-> | ||
- | | ||
- | my $value = $record-> | ||
- | | ||
- | | ||
- | my $value = $record-> | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | print $record-> | ||
- | |||
- | ===== DESCRIPTION ===== | ||
- | This class is a general interface to individual records in esmith::DB databases. | ||
- | |||
- | Each subclass of esmith::DB will also have to subclass and implement an esmith:: | ||
- | ====== Virtual Methods ====== | ||
- | |||
- | ==== key ==== | ||
- | my $key = $record-> | ||
- | |||
- | Returns the $key for this $record; | ||
- | |||
- | ==== props ==== | ||
- | my %properties = $record-> | ||
- | my $num_props | ||
- | |||
- | Returns a hash of all the properties for this $record. | ||
- | |||
- | ===== prop ===== | ||
- | ==== set_prop ==== | ||
- | my $value = $record-> | ||
- | | ||
- | |||
- | Gets/sets the $value of the $property in this $record. | ||
- | |||
- | set_prop() will die if the database is read-only. | ||
- | |||
- | ==== delete_prop ==== | ||
- | my $value = $record-> | ||
- | |||
- | Deletes a $property from the $record, returning the old $value. | ||
- | delete_prop() will die if the database is read-only. | ||
- | |||
- | ==== merge_props ==== | ||
- | | ||
- | |||
- | Adds the %properties to the $records existing properties. | ||
- | |||
- | merge_props() will die if the database is read-only. | ||
- | |||
- | { | ||
- | my $popd = $DB-> | ||
- | my $pop3 = $DB-> | ||
- | $pop3-> | ||
- | $popd-> | ||
- | } | ||
- | |||
- | ==== reset_props ==== | ||
- | | ||
- | |||
- | Replaces the $record’s properties with the contents of %properties. | ||
- | |||
- | reset_props() will die if the database is read-only. | ||
- | |||
- | ==== delete ==== | ||
- | | ||
- | |||
- | Deletes the $record from its database. | ||
- | |||
- | delete() will die if the database is read-only. | ||
- | |||
- | ==== Concrete methods ==== | ||
- | |||
- | === show === | ||
- | my $formatted = $record-> | ||
- | Returns the $record’s key and properties in a nice, human readable format suitable for printing. | ||
- | |||
- | == SEE ALSO == | ||
- | [http:// | ||
- | {{tag> neth-development sme-development }} | ||