DBIx::Romani::Query::Function


DBIx-Romani documentation Contained in the DBIx-Romani distribution.

Index


Code Index:


DBIx-Romani documentation Contained in the DBIx-Romani distribution.
package DBIx::Romani::Query::Function;

use strict;

sub new
{
	my $class = shift;
	my $args  = shift;

	my $self = {
		arguments => [ ]
	};

	bless  $self, $class;
	return $self;
}

sub get_arguments { return shift->{arguments}; }

sub add
{
	my ($self, $arg) = @_;
	push @{$self->{arguments}}, $arg;
}

sub visit
{
	die "Abstract.";
}

sub copy_arguments
{
	my ($self, $other) = @_;

	foreach my $arg ( @{$other->get_arguments()} )
	{
		$self->add_arguments( $arg->clone() );
	}
}

sub clone
{
	my $self = shift;
	my $class = ref($self);

	my $clone;
	$clone = $class->new();
	$clone->copy_arguments( $self );

	return $clone;
}

1;