[vhffs-dev] [1702] Added method to get owner name from object |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 1702
Author: beuss
Date: 2011-05-12 22:10:14 +0200 (Thu, 12 May 2011)
Log Message:
-----------
Added method to get owner name from object
Modified Paths:
--------------
trunk/vhffs-api/src/Vhffs/Object.pm
Modified: trunk/vhffs-api/src/Vhffs/Object.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Object.pm 2011-05-12 20:10:05 UTC (rev 1701)
+++ trunk/vhffs-api/src/Vhffs/Object.pm 2011-05-12 20:10:14 UTC (rev 1702)
@@ -193,6 +193,16 @@
return $self->{'owner_uid'};
}
+sub get_owner_name
+{
+ my ($self) = @_;
+
+ $self->{_owner_name} = scalar($self->{db}->selectrow_array('SELECT username FROM vhffs_users WHERE uid = ?', undef, $self->{owner_uid}))
+ unless(exists($self->{_owner_name}));
+
+ return $self->{_owner_name};
+}
+
sub get_owner_gid
{
my $self = shift;