use pkeyGet for Avatar

darcs-hash:20081002144749-5ed1f-a5503625b811f28a853712d4ddd4a76813f24bc1.gz
This commit is contained in:
Evan Prodromou 2008-10-02 10:47:49 -04:00
parent 2f71f4d95a
commit c8392ed58d
2 changed files with 8 additions and 11 deletions

View File

@ -87,4 +87,8 @@ class Avatar extends Memcached_DataObject
return NULL;
}
}
function &pkeyGet($kv) {
return Memcached_DataObject::pkeyGet('Avatar', $kv);
}
}

View File

@ -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() {