Revision 54fc0d08
Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt
SL/Template/Plugin/LxERP.pm | ||
---|---|---|
1 | 1 |
package SL::Template::Plugin::LxERP; |
2 | 2 |
|
3 | 3 |
use base qw( Template::Plugin ); |
4 |
use Scalar::Util qw(); |
|
4 | 5 |
use Template::Plugin; |
5 | 6 |
|
6 | 7 |
use List::Util qw(min); |
... | ... | |
16 | 17 |
bless { }, $class; |
17 | 18 |
} |
18 | 19 |
|
20 |
sub is_rdbo { |
|
21 |
my ($self, $obj, $wanted_class) = @_; |
|
22 |
|
|
23 |
$wanted_class = !$wanted_class ? 'Rose::DB::Object' |
|
24 |
: $wanted_class =~ m{::} ? $wanted_class |
|
25 |
: "SL::DB::${wanted_class}"; |
|
26 |
|
|
27 |
return Scalar::Util::blessed($obj) ? $obj->isa($wanted_class) : 0; |
|
28 |
} |
|
29 |
|
|
19 | 30 |
sub format_amount { |
20 | 31 |
my ($self, $var, $places, $skip_zero, $dash) = @_; |
21 | 32 |
|
Auch abrufbar als: Unified diff
L-Plugin: Hilfsfunktion is_rdbo($obj) zum Testen ob $obj von einem RDBO ableitet