X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FHelper%2FGetModels.pm;h=6d852288c16df7c4534b306d35a4a3672a574bf8;hb=32f83e8e1c88c04cd9a8686d8482b1473a9d73c5;hp=143e5fe6fd8723c73381f5fa7dab21311ea57116;hpb=78bceadabeadaf766e08c2ad35e3db4b9ff0c3ba;p=kivitendo-erp.git diff --git a/SL/Controller/Helper/GetModels.pm b/SL/Controller/Helper/GetModels.pm index 143e5fe6f..6d852288c 100644 --- a/SL/Controller/Helper/GetModels.pm +++ b/SL/Controller/Helper/GetModels.pm @@ -27,6 +27,13 @@ sub get { return $self->manager->get_all(%params); } +sub count { + my ($self) = @_; + my %params = $self->finalize; + + return $self->manager->get_all_count(%params); +} + sub disable_plugin { my ($self, $plugin) = @_; die 'cannot change internal state after finalize was called' if $self->finalized; @@ -220,13 +227,13 @@ paginating footers. Information about the requested data query can be stored into the object up to a certain point, from which on the object becomes locked and can only be -accessed for information. (Seee TODO STAGES). +accessed for information. (See C). =head1 INTERFACE METHODS =over 4 -=item new PARMAS +=item new PARAMS Create a new GetModels object. Params must have at least an entry C, other than that, see C for options. @@ -293,6 +300,8 @@ certain plugin methods. =head1 DELEGATION METHODS +All of these finalize. + Methods delegating to C: =over 4 @@ -336,16 +345,16 @@ This is the state after creating a new object. =item Init -In this state every information needed from the source ($::form) has beed read +In this state every information needed from the source ($::form) has been read and subsequent changes to the source have no effect. In the current -implementation this will called immediately during creation, so that the return -value of C is already in state C. +implementation this will happen during creation, so that the return value of +C is already in state C. =item Finalized In this state no new configuration will be accepted so that information gotten through the various methods is consistent. Every information retrieval method -will trigger finalizing. +will trigger finalize. =back @@ -376,7 +385,7 @@ Configuration for plugins. If the option for any plugin is omitted, it defaults to enabled and configured by default. Giving a falsish value as first argument will disable the plugin. -If the value is a hashref, it will be passed to the plugin C method. +If the value is a hashref, it will be passed to the plugin's C method. =item query