X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=lib%2FOnis%2FData%2FPersistent.pm;h=08d98ac787ec94b2fc2d2d4796dd0050505d7a5e;hb=ad41998df33de65238b6c185bab62fa7ebe08d79;hp=a2824e6dd2d1e14453b04d230f8dd5dd424a0a2e;hpb=b8e713af047429625b9cfa15feb0a29c185b637a;p=onis.git diff --git a/lib/Onis/Data/Persistent.pm b/lib/Onis/Data/Persistent.pm index a2824e6..08d98ac 100644 --- a/lib/Onis/Data/Persistent.pm +++ b/lib/Onis/Data/Persistent.pm @@ -56,12 +56,15 @@ if (get_config ('storage_module')) if ($@) { print STDERR $/, __FILE__, ": Could not load storage module ``$StoreModule''. Are you sure it exists?"; + print STDERR $/, __FILE__, ": Error while loading was: $@"; exit (1); } unshift (@Onis::Data::Persistent::ISA, $mod_name); } +return (1); + =head1 INTERFACE The child-modules have to provide the following interface: @@ -74,29 +77,33 @@ This is the constructor for the objects that will hold the data. Some modules may need a name for each field, and this is where plugins have to give the name of each field. This is particularly important for backends using relational databeses. I<$name> is merely a name for that variable or, in the database -world - a table. The name must be unique for each calling method's namespace. +world - a table. Since this is a constructor it returns an object. The object "knows" the folling methods: -=item B<$data-Eput> (I<$key>, I<@fields>) +=item B<$obj-Eget> (I<$key>) + +Returns the data associated with the given I<$key> pair or an empty list if no +data has been stored under this tupel before.. + +=item B<$obj-Eput> (I<$key>, I<@fields>) Stores the given values in the data structure. How this is done is described below in L. Doesn't return anything. The number of entries in I<@fields> has to match the number of entries in I<@field_names> when creating the object using B. -=item B<$data-Eget> (I<$key>) - -Returns the data associated with the given I<$key> pair or an empty list if no -data has been stored under this tupel before.. - -=item B<$data-Ekeys> ([I<$field>, ...]) +=item B<$obj-Ekeys> ([I<$field>, ...]) Returns a list of all the keys defined for this object. If one field is given the list will be sorted by that field's values, if more fields are given the list is sorted with the first field taking precedence over the others. If no field is supplied the order is undefined. +=item B<$obj-Edel> (I<$key>) + +Deletes I<$key> and all fields associated with it. + =back =head1 INTERNALS @@ -132,5 +139,3 @@ Florian octo Forster, L. Any comments welcome as long as I haven't started implementing this ;) =cut - -exit (0);