aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ManaTools/Shared/disk_backend/Part.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ManaTools/Shared/disk_backend/Part.pm')
-rw-r--r--lib/ManaTools/Shared/disk_backend/Part.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/ManaTools/Shared/disk_backend/Part.pm b/lib/ManaTools/Shared/disk_backend/Part.pm
index 0b4bb6b6..d30e5864 100644
--- a/lib/ManaTools/Shared/disk_backend/Part.pm
+++ b/lib/ManaTools/Shared/disk_backend/Part.pm
@@ -368,6 +368,18 @@ sub find_parts {
return @res;
}
+sub find_part {
+ my $self = shift;
+ my $parttype = shift;
+ my @tags = @_;
+ my $links = $self->links();
+ my @res = ();
+ for my $link (@{$links}) {
+ return $link->part() if ($link->check($self, $parttype, @tags));
+ }
+ return undef;
+}
+
sub children {
my $self = shift;
my @children = $self->find_parts(undef, 'child');