diff options
Diffstat (limited to 'perllib/FixMyStreet/Cobrand.pm')
-rw-r--r-- | perllib/FixMyStreet/Cobrand.pm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand.pm b/perllib/FixMyStreet/Cobrand.pm index 647261e32..b88f6facc 100644 --- a/perllib/FixMyStreet/Cobrand.pm +++ b/perllib/FixMyStreet/Cobrand.pm @@ -109,4 +109,22 @@ sub get_class_for_moniker { return 'FixMyStreet::Cobrand::Default'; } +=head2 exists + + FixMyStreet::Cobrand->exists( $moniker ); + +Given a moniker, returns true if that cobrand is available to us for use + +=cut + +sub exists { + my ( $class, $moniker ) = @_; + + foreach my $avail ( $class->available_cobrand_classes ) { + return 1 if $moniker eq $avail->{moniker}; + } + + return 0; +} + 1; |