| UR::Object::Command::FetchAndDo(3pm) | User Contributed Perl Documentation | UR::Object::Command::FetchAndDo(3pm) |
UR::Object::Command::FetchAndDo - Base class for fetching objects and then performing a function on/with them.
package MyFecthAndDo;
use strict;
use warnings;
use above "UR";
class MyFecthAndDo {
is => 'UR::Object::Command::FetchAndDo',
has => [
# other properties...
],
};
sub _do { # required
my ($self, $iterator) = @_;
while (my $obj = $iterator->next) {
...
}
return 1;
}
1;
Implement this method to 'do' unto the iterator. Return true for success, false for failure.
sub _do {
my ($self, $iterator) = @_;
while (my $obj = $iterator->next) {
...
}
return 1;
}
The subject_class_name is the class for which the objects will be fetched. It can be specified one of two main ways:
class MyFetchAndDo {
is => 'UR::Object::Command::FetchAndDo',
has => [
subject_class_name => {
value => <CLASS NAME>,
is_constant => 1,
},
],
};
Overwrite the help_brief, help_synopsis and help_detail methods to provide specific help. If overwiting the help_detail method, use call '_filter_doc' to get the filter documentation and usage to combine with your specific help.
| 2022-01-17 | perl v5.32.1 |