« blib/lib/UR/BoolExpr/Template/PropertyComparison/Like.pm
↑ Summary
blib/lib/UR/DataSource/RDBMS/Table.pm »
| 1 | |||
| 2 | package UR::BoolExpr::Template::PropertyComparison::True; | ||
| 3 | |||
| 4 | use strict; | ||
| 5 | use warnings; | ||
| 6 | use UR; | ||
| 7 | our $VERSION = "0.46"; # UR $VERSION; | ||
| 8 | |||
| 9 | UR::Object::Type->define( | ||
| 10 | class_name => __PACKAGE__, | ||
| 11 | is => ['UR::BoolExpr::Template::PropertyComparison'], | ||
| 12 | ); | ||
| 13 | |||
| 14 | sub _compare { | ||
| 15 | my ($class,$comparison_value,@property_value) = @_; | ||
| 16 | no warnings; | ||
| 17 | if (@property_value == 0) { | ||
| 18 | return ''; | ||
| 19 | |||
| 20 | } else { | ||
| 21 | for (@property_value) { | ||
| 22 | return 1 if ($_); # Returns true if _any_ of the values are true | ||
| 23 | } | ||
| 24 | return ''; | ||
| 25 | } | ||
| 26 | } | ||
| 27 | |||
| 28 | |||
| 29 | 1; | ||
| 30 | |||
| 31 | =pod | ||
| 32 | |||
| 33 | =head1 NAME | ||
| 34 | |||
| 35 | UR::BoolExpr::Template::PropertyComparison::True - Evaluates to true if the property's value is true | ||
| 36 | |||
| 37 | If the property returns multiple values, this comparison returns true if any of the values are true | ||
| 38 | |||
| 39 | =cut |