@Ghazascanner
_2019runbot
Ghazascanner File Manager
server :Linux phosweb012 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
Current Path :
/
homepage
/
v-mt
/
extlib
/
TheSchwartz
/
Path :
Upload File :
New :
File
Dir
/homepage/v-mt/extlib/TheSchwartz/FuncMap.pm
# $Id: FuncMap.pm 1098 2007-12-12 01:47:58Z hachi $ package TheSchwartz::FuncMap; use strict; use base qw( Data::ObjectDriver::BaseObject ); use Carp qw( croak ); __PACKAGE__->install_properties({ columns => [ qw( funcid funcname ) ], datasource => 'funcmap', primary_key => 'funcid', }); sub create_or_find { my $class = shift; my($driver, $funcname) = @_; ## Attempt to insert a new funcmap row. Since the funcname column is ## UNIQUE, if the row already exists, an exception will be thrown. my $map = $class->new; $map->funcname($funcname); eval { $driver->insert($map) }; ## If we got an exception, try to load the record with this funcname; ## in all likelihood, the exception was that the record was added by ## another process. if (my $err = $@) { ($map) = $driver->search('TheSchwartz::FuncMap' => { funcname => $funcname } ) or croak "Can't find or create funcname $funcname: $err"; } return $map; } 1;