/[webpac2]/Webpacus/lib/Webpacus/Model/Databases.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /Webpacus/lib/Webpacus/Model/Databases.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 328 by dpavlin, Mon Dec 19 23:51:13 2005 UTC revision 329 by dpavlin, Tue Dec 27 21:36:42 2005 UTC
# Line 91  sub list_inputs { Line 91  sub list_inputs {
91    
92  Returns just of just unique databases with C<name> and C<prefix>.  Returns just of just unique databases with C<name> and C<prefix>.
93    
94     my @dbs = $c->comp('Model::Databases')->list;
95    
96    You can also return just databases that have C<input> defined (that are not
97    empty databases used for agregation) if you add option C<require_input>.
98    
99     my @db_2 = $c->comp('Model::Databases')->list( require_input => 1 );
100    
101  =cut  =cut
102    
103  sub list {  sub list {
104          my $self = shift;          my $self = shift;
105    
106            my $args = shift;
107    
108          my @databases;          my @databases;
109    
110          foreach my $db (keys %{ $self->{databases} }) {          foreach my $db (keys %{ $self->{databases} }) {
111                  my $d = $self->{databases}->{$db} || die;                  my $d = $self->{databases}->{$db} || die;
112    
113                    if ($args->{require_input}) {
114                            next unless ($d->{input});
115                    }
116    
117                  my $el = {                  my $el = {
118                          name    => $self->convert( $d->{name} || $db ),                          name    => $self->convert( $d->{name} || $db ),
119                          prefix  => $self->convert( $db ),                          prefix  => $self->convert( $db ),

Legend:
Removed from v.328  
changed lines
  Added in v.329

  ViewVC Help
Powered by ViewVC 1.1.26