Mokoala v4.0

§ Module » RecordUser::addFriend()

Creates a friendship between the selected user and the user provided in the $friend variable. If a friendship already exists then no action is taken.

ParameterTypeDefault
$friendMK_RecordUserNo defaultThe user that you want to add as one of the current user's friends.

In the following example I will take the currently authorized user and send a friend request to the user with the ID 3.

$user_module = MK_RecordModuleManager::getFromType('user');

$user = MK_Authorizer::authorize();

$friend = MK_RecordManager::getFromId( $user_module->getId(), 3 );

$user->addFriend( $friend );

The user, represented by the $friend variable, will be sent a notification informing them that they have a pending friend request.

Authorizer

Cookie

Form

Form.Field

Module

Session

Utility

levitra online