| 1 |
# |
| 2 |
# $Id: ReqCond.pm 757 2007-01-05 10:56:28Z bastian $ |
| 3 |
# |
| 4 |
# Perl module for Kamailio |
| 5 |
# |
| 6 |
# Copyright (C) 2006 Collax GmbH |
| 7 |
# (Bastian Friedrich <[email protected]>) |
| 8 |
# |
| 9 |
# This file is part of Kamailio, a free SIP server. |
| 10 |
# |
| 11 |
# Kamailio is free software; you can redistribute it and/or modify |
| 12 |
# it under the terms of the GNU General Public License as published by |
| 13 |
# the Free Software Foundation; either version 2 of the License, or |
| 14 |
# (at your option) any later version |
| 15 |
# |
| 16 |
# Kamailio is distributed in the hope that it will be useful, |
| 17 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 |
# GNU General Public License for more details. |
| 20 |
# |
| 21 |
# You should have received a copy of the GNU General Public License |
| 22 |
# along with this program; if not, write to the Free Software |
| 23 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 24 |
# |
| 25 |
|
| 26 |
=head1 Kamailio::VDB::ReqCond |
| 27 |
|
| 28 |
This package represents a request condition for database access, consisting of a |
| 29 |
column name, an operator (=, <, >, ...), a data type and a value. |
| 30 |
|
| 31 |
This package inherits from Kamailio::VDB::Pair and thus includes its methods. |
| 32 |
|
| 33 |
=cut |
| 34 |
|
| 35 |
package Kamailio::VDB::ReqCond; |
| 36 |
|
| 37 |
use Kamailio::VDB::Value; |
| 38 |
use Kamailio::VDB::Pair; |
| 39 |
|
| 40 |
our @ISA = qw ( Kamailio::VDB::Pair Kamailio::Utils::Debug ); |
| 41 |
|
| 42 |
=head2 new(key,op,type,name) |
| 43 |
|
| 44 |
Constructs a new Column object. |
| 45 |
|
| 46 |
=cut |
| 47 |
|
| 48 |
sub new { |
| 49 |
my $class = shift; |
| 50 |
my $key = shift; |
| 51 |
my $op = shift; |
| 52 |
my $type = shift; |
| 53 |
my $data = shift; |
| 54 |
|
| 55 |
my $self = new Kamailio::VDB::Pair($key, $type, $data); |
| 56 |
|
| 57 |
bless $self, $class; |
| 58 |
|
| 59 |
$self->{op} = $op; |
| 60 |
|
| 61 |
return $self; |
| 62 |
} |
| 63 |
|
| 64 |
|
| 65 |
=head2 op() |
| 66 |
|
| 67 |
Returns or sets the current operator. |
| 68 |
|
| 69 |
=cut |
| 70 |
|
| 71 |
sub op { |
| 72 |
my $self = shift; |
| 73 |
if (@_) { |
| 74 |
$self->{op} = shift; |
| 75 |
} |
| 76 |
|
| 77 |
return $self->{op}; |
| 78 |
} |
| 79 |
|
| 80 |
1; |