mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-11 12:32:37 +01:00
DualIndexSQLiteObject: add missing get_key_name() subroutine
This commit is contained in:
parent
b54360485d
commit
1124f4716a
@ -471,6 +471,32 @@ sub get_all {
|
|||||||
return @$data;
|
return @$data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub get_key_name {
|
||||||
|
my ($self, $index1, $index2) = @_;
|
||||||
|
|
||||||
|
my $lc_index1 = lc $index1;
|
||||||
|
|
||||||
|
return $lc_index1 if not exists $self->{cache}->{$lc_index1};
|
||||||
|
|
||||||
|
if (not defined $index2) {
|
||||||
|
if (exists $self->{cache}->{$lc_index1}->{_name}) {
|
||||||
|
return $self->{cache}->{$lc_index1}->{_name};
|
||||||
|
} else {
|
||||||
|
return $lc_index1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
my $lc_index2 = lc $index2;
|
||||||
|
|
||||||
|
return $lc_index2 if not exists $self->{cache}->{$lc_index1}->{$lc_index2};
|
||||||
|
|
||||||
|
if (exists $self->{cache}->{$lc_index1}->{$lc_index2}->{_name}) {
|
||||||
|
return $self->{cache}->{$lc_index1}->{$lc_index2}->{_name};
|
||||||
|
} else {
|
||||||
|
return $lc_index2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub get_data {
|
sub get_data {
|
||||||
my ($self, $index1, $index2, $data_index) = @_;
|
my ($self, $index1, $index2, $data_index) = @_;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user