forked from GNUsocial/gnu-social
use pkeyGet for Avatar
darcs-hash:20081002144749-5ed1f-a5503625b811f28a853712d4ddd4a76813f24bc1.gz
This commit is contained in:
parent
2f71f4d95a
commit
c8392ed58d
@ -87,4 +87,8 @@ class Avatar extends Memcached_DataObject
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
function &pkeyGet($kv) {
|
||||
return Memcached_DataObject::pkeyGet('Avatar', $kv);
|
||||
}
|
||||
}
|
||||
|
@ -47,19 +47,12 @@ class Profile extends Memcached_DataObject
|
||||
###END_AUTOCODE
|
||||
|
||||
function getAvatar($width, $height=NULL) {
|
||||
$avatar = DB_DataObject::factory('avatar');
|
||||
$avatar->profile_id = $this->id;
|
||||
$avatar->width = $width;
|
||||
if (is_null($height)) {
|
||||
$avatar->height = $width;
|
||||
} else {
|
||||
$avatar->height = $height;
|
||||
}
|
||||
if ($avatar->find(true)) {
|
||||
return $avatar;
|
||||
} else {
|
||||
return NULL;
|
||||
$height = $width;
|
||||
}
|
||||
return Avatar::pkeyGet(array('profile_id' => $this->id,
|
||||
'width' => $width,
|
||||
'height' => $height));
|
||||
}
|
||||
|
||||
function getOriginalAvatar() {
|
||||
|
Loading…
Reference in New Issue
Block a user