CloudAssest hotfix

Change-Id: I23f38fa7e5c86e44ff055259091ee3dc2256a49d
This commit is contained in:
smarcet 2019-04-01 14:56:52 -03:00
parent 84df8f2923
commit 7d45396b79
2 changed files with 46 additions and 3 deletions

View File

@ -1084,12 +1084,34 @@ SQL;
return $fullname;
}
/**
* @return bool
*/
public function hasPhoto(){
return $this->getPhotoId() > 0;
}
/**
* @return int
*/
public function getPhotoId()
{
try{
if(is_null($this->photo)) return 0;
return $this->photo->getId();
}
catch(\Exception $ex){
return 0;
}
}
/**
* @return string
*/
public function getProfilePhotoUrl():string{
$photoUrl = null;
if($photo = $this->getPhoto()){
if($this->hasPhoto() && $photo = $this->getPhoto()){
$photoUrl = $photo->getUrl();
}
if(empty($photo_url) && !empty($this->getTwitterHandle()) ){

View File

@ -1579,15 +1579,36 @@ SQL;
return $email ? $email->getType() : null;
}
/**
* @return bool
*/
public function hasPhoto(){
return $this->getPhotoId() > 0;
}
/**
* @return int
*/
public function getPhotoId()
{
try{
if(is_null($this->photo)) return 0;
return $this->photo->getId();
}
catch(\Exception $ex){
return 0;
}
}
/**
* @return string
*/
public function getProfilePhotoUrl():string{
$photoUrl = null;
if($photo = $this->getPhoto()){
if($this->hasPhoto() && $photo = $this->getPhoto()){
$photoUrl = $photo->getUrl();
}
if(empty($photo_url) && $this->hasMember() && $photo = $this->member->getPhoto()){
if(empty($photo_url) && $this->hasMember() && $this->member->hasPhoto() && $photo = $this->member->getPhoto()){
$photoUrl = $photo->getUrl();
}
if(empty($photo_url) && !empty($this->getTwitterName()) ){