X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FProfile.php;h=eb29d63a27977cea8a654439b2d500969ffa9904;hb=9bb55af26f47d960cc33b02ec355d832d18b31b7;hp=d6535238ac9e9dd470e3cd80ba96b4e6d41ec4c9;hpb=0036795582aa3fca078e744ae1bd96a9e417d361;p=quix0rs-gnu-social.git diff --git a/classes/Profile.php b/classes/Profile.php index d6535238ac..eb29d63a27 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -1,5 +1,24 @@ . + */ + +if (!defined('LACONICA')) { exit(1); } + /** * Table Definition for profile */ @@ -26,4 +45,31 @@ class Profile extends DB_DataObject /* the code above is auto generated do not remove the tag below */ ###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; + } + } + + function getOriginalAvatar() { + $avatar = DB_DataObject::factory('avatar'); + $avatar->profile_id = $this->id; + $avatar->original = true; + if ($avatar->find(true)) { + return $avatar; + } else { + return NULL; + } + } }