Commit c8392ed5 authored by Evan Prodromou's avatar Evan Prodromou

use pkeyGet for Avatar

darcs-hash:20081002144749-5ed1f-a5503625b811f28a853712d4ddd4a76813f24bc1.gz
parent 2f71f4d9
......@@ -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() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment