package Common::Core::Result;

## port from PHP Core_Result class
## XXX: here should be autoloader method, instead of these accessors!

use strict;
use warnings;
use lib $ENV{'CF_SYSTEM_ROOT'}.'/lib/common/perl';

use Common::Core::Constants;


sub new {
	my $class = shift or die ("Bad class operation!");
	my %args = (
		'res_code' => undef,
		'data' => undef,
		'err_code' => undef,
		'err_msg' => undef,
		@_
	);

	my $self = \%args;
	bless($self, $class);

	return $self;
}

sub res_code {
	my $self = shift or die("Bad method call!");

	return $self->{'res_code'};
}


sub data {
	my $self = shift or die("Bad method call!");

	return $self->{'data'};
}

sub err_code {
	my $self = shift or die("Bad method call!");

	return $self->{'err_code'};
}

sub err_msg {
	my $self = shift or die("Bad method call!");

	return $self->{'err_msg'};
}


1;
