Version 5.0.13
This commit is contained in:
1 parent
b89858b2ff
commit
5efe744c5f
1407 files changed
+69690
-30177
No files matched your search
@@ -13,6 +13,7 @@ namespace IPS\Content;
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
|
||||
use Exception;
|
||||
use IPS\IPS;
|
||||
use IPS\Node\CustomBadge;
|
||||
use IPS\Platform\Bridge;
|
||||
use IPS\Data\Store;
|
||||
@@ -257,8 +258,16 @@ class Reaction extends Model
|
||||
{
|
||||
return $badge->file()?->url;
|
||||
}
|
||||
if( $this->_data['icon'] )
|
||||
{
|
||||
try
|
||||
{
|
||||
return File::get( 'core_Reaction', $this->_data['icon'] );
|
||||
}
|
||||
catch( Exception $e ){}
|
||||
|
||||
return File::get( 'core_Reaction', $this->_data['icon'] );
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -489,4 +498,25 @@ class Reaction extends Model
|
||||
|
||||
parent::delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get output for API
|
||||
*
|
||||
* @param Member|NULL $authorizedMember The member making the API request or NULL for API Key / client_credentials
|
||||
* @return array
|
||||
* @apiresponse int id ID number
|
||||
* @apiresponse string icon URL to the icon,
|
||||
* @apiresponse string value Value of the reaction
|
||||
*/
|
||||
public function apiOutput( Member $authorizedMember = NULL ): array
|
||||
{
|
||||
$return = array(
|
||||
'id' => $this->id,
|
||||
'title' => $this->title,
|
||||
'icon' => (string) $this->icon,
|
||||
'value' => $this->value
|
||||
);
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user