class Foaf

Methods

add_follow_user(int $user_following, int $user_to_follow, string $status = 'auto_follow')

Add user as follower of an user

bool
connect(int $targetId, int|null $sourceId = null)

No description

bool
disconnect(int $first_id, int $second_id = 0, bool $remove_two_way = false)

Removes the two way connection between first id and second id and leaves a oneway between second and first

array
getAllContacts(int $fromId, int $targetLevel = 1, string $mode = 'explicit', bool $showHidden = false)

No description

array
getConnectionPath(int $targetId, int|null $sourceId = null, int $level = 2)

No description

array
get_contact_id_list(int $from_id, int $level = 1)

Same as get_all_contacts but returns 1-dim array conaining only the user ids

array
get_pending_contacts(int $user_id, string $direction = 'from', bool $show_hidden = true)

returns all pending contacts

array
get_pending_contacts_from(int $user_id, bool $show_hidden = true)

returns all pending contacts from user [overloaded function of get_pending_contacts_to()]

array
get_pending_contacts_to(int $user_id, bool $show_hidden = true)

returns all pending contacts to user [overloaded function of get_pending_contacts_to()]

bool
hide_connection(int $to_id, int|null $from_id = null)

No description

int|null
isConnected(int $targetId, int|null $sourceId = null)

No description

bool
is_contact(int $to_id, bool|int $from_id = false, bool|string $only_two_way_connection = 'auto')

True if ot_id user is a direct contact of the from_id

bool
is_pending_connection(int $to_id, bool|int $from_id = false, bool $show_hidden = true)

Returns true of the first passed user has requested the contact for the second and is still pending

remove_follow_user(int $user_following, int $user_to_follow)

Remove user as follower of an user

Details

at line 613
add_follow_user(int $user_following, int $user_to_follow, string $status = 'auto_follow')

Add user as follower of an user

Parameters

int $user_following
int $user_to_follow
string $status ('follow','auto_follow','ignore')

at line 31
bool connect(int $targetId, int|null $sourceId = null)

No description

Parameters

int $targetId

to id

int|null $sourceId

from id

Return Value

bool

Exceptions

Exception

at line 109
bool disconnect(int $first_id, int $second_id = 0, bool $remove_two_way = false)

Removes the two way connection between first id and second id and leaves a oneway between second and first

Parameters

int $first_id

From ID

int $second_id

To ID (current user if false)

bool $remove_two_way

Return Value

bool

Exceptions

Exception

at line 210
array getAllContacts(int $fromId, int $targetLevel = 1, string $mode = 'explicit', bool $showHidden = false)

No description

Parameters

int $fromId

user id

int $targetLevel

how many levels deep (1 = direct contact). Please use max = 2 only!

string $mode

'explicit' only the specified level or all levels

bool $showHidden

Return Value

array

of all ids and its levels

at line 167
array getConnectionPath(int $targetId, int|null $sourceId = null, int $level = 2)

No description

Parameters

int $targetId

The target user id

int|null $sourceId

From which id to look from, defaults to current user id if null

int $level

max connection level to look for (max 2)

Return Value

array

with ids from source to target

at line 401
array get_contact_id_list(int $from_id, int $level = 1)

Same as get_all_contacts but returns 1-dim array conaining only the user ids

Parameters

int $from_id id
int $level

level, default: 1 -> direct contacts

Return Value

array

of all ids and it's level

at line 305
array get_pending_contacts(int $user_id, string $direction = 'from', bool $show_hidden = true)

returns all pending contacts

Parameters

int $user_id

User id

string $direction

'from' [unconfirmed contacts] or 'to' [contacts to confirm]

bool $show_hidden

show hidden entries. Entries are hidden if a two way connection is deleted by one side

Return Value

array

of all ids and it's level

at line 282
array get_pending_contacts_from(int $user_id, bool $show_hidden = true)

returns all pending contacts from user [overloaded function of get_pending_contacts_to()]

Parameters

int $user_id

source User id

bool $show_hidden

show hidden entries. Entries are hidden if a two way connection is deleted by one side

Return Value

array

of all ids and it's level

at line 293
array get_pending_contacts_to(int $user_id, bool $show_hidden = true)

returns all pending contacts to user [overloaded function of get_pending_contacts_to()]

Parameters

int $user_id

target User id

bool $show_hidden

show hidden entries. Entries are hidden if a two way connection is deleted by one side

Return Value

array

of all ids and it's level

at line 502
bool hide_connection(int $to_id, int|null $from_id = null)

No description

Parameters

int $to_id to_id
int|null $from_id from_id

Return Value

bool

false if not added

at line 152
int|null isConnected(int $targetId, int|null $sourceId = null)

No description

Parameters

int $targetId

Target user id

int|null $sourceId

source user id, defaults to current user id if null

Return Value

int|null

level of connection (1 - direct contact)

at line 343
bool is_contact(int $to_id, bool|int $from_id = false, bool|string $only_two_way_connection = 'auto')

True if ot_id user is a direct contact of the from_id

Parameters

int $to_id
bool|int $from_id
bool|string $only_two_way_connection

Count only two-way connections

Return Value

bool

at line 369
bool is_pending_connection(int $to_id, bool|int $from_id = false, bool $show_hidden = true)

Returns true of the first passed user has requested the contact for the second and is still pending

Parameters

int $to_id to_id
bool|int $from_id from_id
bool $show_hidden

Return Value

bool

true if is direct connected

at line 634
remove_follow_user(int $user_following, int $user_to_follow)

Remove user as follower of an user

Parameters

int $user_following
int $user_to_follow