1132 |
my $filter = ""; |
my $filter = ""; |
1133 |
my @params = (); |
my @params = (); |
1134 |
if (defined($actualObjectID)) { |
if (defined($actualObjectID)) { |
1135 |
# Here the caller wants to filter on object ID. |
# Here the caller wants to filter on object ID. Check for a pattern. |
1136 |
$filter = "$entityType(id) = ? AND "; |
my $comparator = ($actualObjectID =~ /%/ ? "LIKE" : "="); |
1137 |
|
# Update the filter and the parameter list. |
1138 |
|
$filter = "$entityType(id) $comparator ? AND "; |
1139 |
push @params, $actualObjectID; |
push @params, $actualObjectID; |
1140 |
} |
} |
1141 |
# It's time to begin making queries. We process one attribute key at a time, because |
# It's time to begin making queries. We process one attribute key at a time, because |
1379 |
my %secondaries = $self->GetSecondaryFields($entityType); |
my %secondaries = $self->GetSecondaryFields($entityType); |
1380 |
if (exists $secondaries{$key}) { |
if (exists $secondaries{$key}) { |
1381 |
# We found it, so delete all the values of the key. |
# We found it, so delete all the values of the key. |
1382 |
$self->DeleteValue($entityName, undef, $key); |
$self->DeleteValue($entityType, undef, $key); |
1383 |
} |
} |
1384 |
} |
} |
1385 |
# Return a 1, for backward compatability. |
# Return a 1, for backward compatability. |
1386 |
return 1; |
return 1; |
1387 |
} |
} |
1388 |
|
|
1389 |
|
=head3 GetAttributeKeys |
1390 |
|
|
1391 |
|
C<< my @keyList = $attrDB->GetAttributeKeys($entityName); >> |
1392 |
|
|
1393 |
|
Return a list of the attribute keys for a particular entity type. |
1394 |
|
|
1395 |
|
=over 4 |
1396 |
|
|
1397 |
|
=item entityName |
1398 |
|
|
1399 |
|
Name of the entity whose keys are desired. |
1400 |
|
|
1401 |
|
=item RETURN |
1402 |
|
|
1403 |
|
Returns a list of the attribute keys for the specified entity. |
1404 |
|
|
1405 |
|
=back |
1406 |
|
|
1407 |
|
=cut |
1408 |
|
|
1409 |
|
sub GetAttributeKeys { |
1410 |
|
# Get the parameters. |
1411 |
|
my ($self, $entityName) = @_; |
1412 |
|
# Get the entity's secondary fields. |
1413 |
|
my %keyList = $self->GetSecondaryFields($entityName); |
1414 |
|
# Return the keys. |
1415 |
|
return sort keys %keyList; |
1416 |
|
} |
1417 |
|
|
1418 |
1; |
1; |