Skip to content
Snippets Groups Projects
Commit 89596089 authored by renater.salaun's avatar renater.salaun
Browse files

Now inheriting from IdPAccountManager::Data::Serviceprovider

git-svn-id: https://svn.geant.net/GEANT/edugain_testidp_account_manager/trunk@74 047e039d-479c-447e-8a29-aa6bf4a09bab
parent c9182fff
No related branches found
No related tags found
No related merge requests found
package IdPAccountManager::ServiceProvider;
use parent 'IdPAccountManager::Data::Serviceprovider';
use strict;
......@@ -14,63 +15,11 @@ my @EXPORT = qw();
use Carp;
INIT {
INIT {
## Set error mode to non fatal
IdPAccountManager::Data::Serviceprovider::Manager->error_mode('return');
}
sub new {
my ($pkg) = shift;
my %args = @_;
my $self = {};
## Bless ServiceProvider object
bless $self, $pkg;
## Object may be created either with a hashref as argument or an IdPAccountManager::Data::Serviceprovider object
## Second case is usefull when fetching a set of IdPAccountManager::Data::Serviceprovider via IdPAccountManager::Data::Serviceprovider::Manager
if (ref($_[0]) eq 'IdPAccountManager::Data::Serviceprovider') {
$self->{'persistent'} = $_[0];
}else {
$self->{'persistent'} = IdPAccountManager::Data::Serviceprovider->new(%args);
}
return $self;
}
sub load {
my $self = shift;
my %args = @_;
return $self->{'persistent'}->load(%args);
}
sub get {
my $self = shift;
my $attribute_name = shift;
return $self->{'persistent'}->$attribute_name;
}
sub save {
my $self = shift;
unless ($self->{'persistent'}->save()) {
IdPAccountManager::Tools::do_log('error', "Failed to save Serviceprovider in DB");
return undef;
}
}
## Delete a test account
sub delete {
my $self = shift;
unless ($self->{'persistent'}->delete()) {
IdPAccountManager::Tools::do_log('error', "Failed to delete a Serviceprovider in DB");
return undef;
}
}
## Print the content of a test account
sub print {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment