line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WWW::BigDoor::Profile; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
12478
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
72
|
|
4
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
55
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
10
|
use Data::Dumper; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
111
|
|
7
|
2
|
|
|
2
|
|
12
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
128
|
|
8
|
|
|
|
|
|
|
#use Smart::Comments -ENV; |
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
58
|
use WWW::BigDoor::EndUser; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
18
|
|
11
|
2
|
|
|
2
|
|
91
|
use base qw(WWW::BigDoor::Resource Class::Accessor); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
12504
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
__PACKAGE__->follow_best_practice; |
14
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors( |
15
|
|
|
|
|
|
|
qw(id provider email first_name last_name display_name profile_photo end_user_obj is_saved ) ); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
1
|
|
|
1
|
1
|
3041
|
my ( $class, $end_user_obj, $args ) = @_; |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
14
|
my $self = $class->SUPER::new( $args ); |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
|
|
5
|
$self->set_is_saved( 0 ); |
23
|
1
|
|
|
|
|
29
|
$self->set_end_user_obj( $end_user_obj ); |
24
|
1
|
|
|
|
|
11
|
return $self; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub get_id { |
28
|
2
|
|
|
2
|
1
|
4
|
my ( $self ) = @_; |
29
|
|
|
|
|
|
|
|
30
|
2
|
100
|
|
|
|
8
|
return $self->get_provider() if $self->get_is_saved; |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
13
|
return; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub end_point { |
36
|
2
|
|
|
2
|
1
|
4
|
my ( $self, $end_user_obj ) = @_; |
37
|
2
|
|
|
|
|
11
|
my $ep = $self->_end_point; |
38
|
|
|
|
|
|
|
|
39
|
2
|
50
|
|
|
|
8
|
unless ( defined $end_user_obj ) { |
40
|
2
|
50
|
|
|
|
6
|
croak "Need EndUser object as parameter" unless ref $self; |
41
|
2
|
|
|
|
|
9
|
$end_user_obj = $self->get_end_user_obj; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
### end_user_obj: Dumper($end_user_obj) |
44
|
|
|
|
|
|
|
|
45
|
2
|
|
|
|
|
33
|
my $end_user_login = $end_user_obj->get_end_user_login(); |
46
|
|
|
|
|
|
|
### end_user_login: $end_user_login |
47
|
|
|
|
|
|
|
### _end_point: $self->_end_point() |
48
|
|
|
|
|
|
|
### _parent_end_point: $self->_parent_end_point() |
49
|
|
|
|
|
|
|
|
50
|
2
|
|
|
|
|
21
|
$ep = sprintf '%s/%s/%s', $self->_parent_end_point(), $end_user_login, $self->_end_point(); |
51
|
|
|
|
|
|
|
### ep with parent: $ep |
52
|
2
|
|
|
|
|
9
|
return $ep; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub save { |
56
|
1
|
|
|
1
|
1
|
6751
|
my ( $self, @args ) = @_; |
57
|
1
|
|
|
|
|
9
|
$self->SUPER::save( @args ); |
58
|
1
|
|
|
|
|
4
|
$self->set_is_saved( 1 ); |
59
|
1
|
|
|
|
|
11
|
return $self; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub load { |
63
|
0
|
|
|
0
|
1
|
0
|
my ( $self, @args ) = @_; |
64
|
0
|
|
|
|
|
0
|
$self->SUPER::load( @args ); |
65
|
0
|
|
|
|
|
0
|
$self->set_is_saved( 1 ); |
66
|
0
|
|
|
|
|
0
|
return $self; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub remove { |
70
|
1
|
|
|
1
|
1
|
7360
|
my $self = shift; |
71
|
1
|
|
|
|
|
11
|
$self->SUPER::remove( @_ ); |
72
|
1
|
|
|
|
|
5
|
$self->set_is_saved( 0 ); |
73
|
1
|
|
|
|
|
10
|
return $self; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub _parent_end_point { ## no critic (ProhibitUnusedPrivateSubroutines) |
77
|
2
|
|
|
2
|
|
8
|
return 'end_user'; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub _parent_id_attr { ## no critic (ProhibitUnusedPrivateSubroutines) |
81
|
0
|
|
|
0
|
|
|
return 'end_user_login'; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; |
85
|
|
|
|
|
|
|
__END__ |