Skip to main content

SDK Instance

The Sociable class is the main entry point for all SDK functionality.

Getting the Instance

use Joomla\Component\Sociable\Administrator\SDK\Sociable;

$sociable = Sociable::getInstance();

Available API Methods

MethodReturnsDescription
profiles()ProfileApiUser profile management
avatars()AvatarApiAvatar image handling
points()PointsApiPoints/rewards system
badges()BadgeApiBadge/achievement system
activities()ActivityApiActivity stream
notifications()NotificationApiNotification system
connections()ConnectionApiUser relationships
events()EventApiEvent management
groups()GroupApiGroup/community management
ruleEngine()RuleEngineRule evaluation and management
legacy()LegacyBridgeBackward compatibility layer

Quick Shortcut Methods

$sociable->awardPoints('com_extension.rule.name', $userId);
$sociable->triggerBadge('com_extension.badge.rule', $userId, ['posts' => 10]);
$sociable->pushActivity('post.create', $userId, ['title' => 'New Post']);
$sociable->notify($recipientId, 'new_comment', ['actor_id' => $commenterId]);