Function __global->friend_add
Definitions
sources/chat2.php
- Add a friend.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: bool
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $likes | MEMBER | No | No | required parameter | N/A | N/A | The member befriending |
| $liked | MEMBER | No | No | required parameter | N/A | N/A | The member being befriended |
| $time | ?TIME | No | No | Null | N/A | N/A | The logged time of the friendship (null: now) |
| $send_notification | boolean | No | No | True | N/A | N/A | Whether to send a notification suggesting to do an opposite-way friendship |
Returns
- Whether a mutual-add link was sent
- Type: boolean
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Add a friend.
*
* @param MEMBER $likes The member befriending
* @param MEMBER $liked The member being befriended
* @param ?TIME $time The logged time of the friendship (null: now)
* @param boolean $send_notification Whether to send a notification suggesting to do an opposite-way friendship
* @return boolean Whether a mutual-add link was sent
*/
function friend_add(int $likes, int $liked, ?int $time = null, bool $send_notification = true) : bool
* Add a friend.
*
* @param MEMBER $likes The member befriending
* @param MEMBER $liked The member being befriended
* @param ?TIME $time The logged time of the friendship (null: now)
* @param boolean $send_notification Whether to send a notification suggesting to do an opposite-way friendship
* @return boolean Whether a mutual-add link was sent
*/
function friend_add(int $likes, int $liked, ?int $time = null, bool $send_notification = true) : bool

