Properties

$thread_id

$thread_id : 

Type

Methods

__construct()

__construct(  $phapper,   $thread_id) 

Parameters

$phapper
$thread_id

getThreadId()

getThreadId() : string

Returns the thread ID of the current thread. Useful for newly created threads.

Returns

string —

Thread ID.

acceptContributorInvite()

acceptContributorInvite() : object

Accepts a pending invitation to contribute to the live thread.

Returns

object —

Response to API call.

close()

close() : object

Permanently closes the live thread.

Returns

object —

Response to API call.

deleteUpdate()

deleteUpdate(string  $update_id) : object

Deletes the specified update.

Parameters

string $update_id

ID (rather, name attribute) of update to delete.

Returns

object —

Response to API call.

editSettings()

editSettings(string|null  $title = null, string|null  $description = null, string|null  $resources = null, boolean|null  $nsfw = null) : mixed|null

Edit the settings for the live thread.

Parameters

string|null $title

The thread's title.

string|null $description

The thread's description.

string|null $resources

The thread's resources section in the sidebar.

boolean|null $nsfw

Whether or not the thread is NSFW. Prompts guests to continue when visiting.

Returns

mixed|null —

Response to API call OR null if not all settings defined and getting current settings failed.

inviteContributor()

inviteContributor(string  $user, boolean  $perm_all = true, boolean  $perm_close = false, boolean  $perm_edit = false, boolean  $perm_manage = false, boolean  $perm_settings = false, boolean  $perm_update = false) : object

Invite a user as a contributor to the live thread.

Parameters

string $user

Username of user to invite.

boolean $perm_all

If the user should have full permissions.

boolean $perm_close

If the user should have the 'close live thread' permission. User must have 'settings' too to close via the web UI.

boolean $perm_edit

If the user should have the 'edit' permission.

boolean $perm_manage

If the user should have the 'manage contributors' permission.

boolean $perm_settings

If the user should have the 'settings' permission.

boolean $perm_update

If the user should have the 'update' permission.

Returns

object —

Response to API call.

leaveContributor()

leaveContributor() : object

Abdicate contributorship of the thread.

Returns

object —

Response to API call.

report()

report(string  $type) : object

Report the thread to the reddit admins for breaking one of the site's rules.

Parameters

string $type

One of 'spam', 'vote-manipulation', 'personal-information', 'sexualizing-minors', 'site-breaking'.

Returns

object —

Response to API call.

removeContributor()

removeContributor(string  $user) : object|null

Remove a user as a contributor from the thread. To revoke a pending invitation, use uninviteContributor().

Parameters

string $user

Username of user to remove from thread's contributor list.

Returns

object|null —

Response to API call OR null if the user does not exist.

uninviteContributor()

uninviteContributor(string  $user) : object|null

Revoke a pending contributor invitation. To remove a current contributor, use removeContributor().

Parameters

string $user

Username of user to uninvite.

Returns

object|null —

Response to API call OR null if the user does not exit.

setContributorPermissions()

setContributorPermissions(string  $user, boolean  $perm_all = true, boolean  $perm_close = false, boolean  $perm_edit = false, boolean  $perm_manage = false, boolean  $perm_settings = false, boolean  $perm_update = false) : object

Modify a current contributor's permission set. To modify an invited contributor's permissions, use setInvitationPermissions().

Parameters

string $user

Username of user for which to edit permissions.

boolean $perm_all

If the user should have full permissions.

boolean $perm_close

If the user should have the 'close live thread' permission. User must have 'settings' too to close via the web UI.

boolean $perm_edit

If the user should have the 'edit' permission.

boolean $perm_manage

If the user should have the 'manage contributors' permission.

boolean $perm_settings

If the user should have the 'settings' permission.

boolean $perm_update

If the user should have the 'update' permission.

Returns

object —

Response to API call.

setInvitationPermissions()

setInvitationPermissions(string  $user, boolean  $perm_all = true, boolean  $perm_close = false, boolean  $perm_edit = false, boolean  $perm_manage = false, boolean  $perm_settings = false, boolean  $perm_update = false) : object

Modify an invited contributor's permission set. To modify a current contributor's permissions, use setContributorPermissions().

Parameters

string $user

Username of user for which to edit permissions.

boolean $perm_all

If the user should have full permissions.

boolean $perm_close

If the user should have the 'close live thread' permission. User must have 'settings' too to close via the web UI.

boolean $perm_edit

If the user should have the 'edit' permission.

boolean $perm_manage

If the user should have the 'manage contributors' permission.

boolean $perm_settings

If the user should have the 'settings' permission.

boolean $perm_update

If the user should have the 'update' permission.

Returns

object —

Response to API call.

strikeUpdate()

strikeUpdate(string  $update_id) : object

Strikes the specified update, which will show up as crossed out in the live thread.

Parameters

string $update_id

ID (rather, name attribute) of update to strike.

Returns

object —

Response to API call.

update()

update(string  $body) : object

Makes an update on the live thread.

Parameters

string $body

Body of update to post.

Returns

object —

Response to API call. Unfortunately, no update ID is returned yet. You need to run getUpdates() to find this.

getUpdates()

getUpdates(integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieves updates on a thread.

Parameters

integer $limit

Upper limit of the number of links to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically. Should be the name of an update: "LiveUpdate_..."

string|null $before

Get items higher on list than this entry. Does not mean chronologically. Should be the name of an update: "LiveUpdate_..."

Returns

object —

Listing of LiveUpdate objects.

about()

about() : object

Retrieves information about the live thread.

Returns

object —

LiveUpdateEvent object.

getContributors()

getContributors() : object|array

Retrieves a list of contributors for the thread. To see invitations, the current user must have the 'manage' permission.

Returns

object|array —

UserList object OR array of two UserList objects if there are visible pending invitations.

getDiscussions()

getDiscussions(integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieves a list of discussions about the current thread.

Parameters

integer $limit

Upper limit of the number of links to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of posts.

apiCall()

apiCall(  $path,   $method = 'GET',   $params = null) 

Parameters

$path
$method
$params

liveCall()

liveCall(  $path,   $method = 'GET',   $params = null) 

Parameters

$path
$method
$params