Show:

Streams_Participant Class

Extends Base_Streams_Participant
Module: Streams

Class representing 'Participant' rows in the 'Streams' database You can create an object of this class either to access its non-static methods, or to actually represent a participant row in the Streams database.

Methods

__set_state

(
  • $array
)
Streams_Participant

Implements the __set_state method, so it can work with with var_export and be re-imported successfully.

Parameters:

  • $array Array

Returns:

Streams_Participant:

Class instance

afterSaveExecute

(
  • $result
  • $query
)
Db_Result

Parameters:

Returns:

beforeSave

(
  • $modifiedFields
)
Array

Parameters:

  • $modifiedFields Array

    The fields that were modified

Returns:

Array:

clearExtra

(
  • $extraName
)

Parameters:

  • $extraName String

    The name of the extra to remove

exportArray()

(
  • $options=null
)
Array

Convert participant object to array safe to show to a user

Parameters:

  • $options=null Array

Returns:

Array:

filter

(
  • $userIds
  • $publisherId
  • $streamName
  • $state
)
Array static

Filter to just the ids of users which are, or are not, participating in a stream

Parameters:

  • $userIds Array

    An array of user ids to filter

  • $publisherId String

    The id of the publisher of the stream

  • $streamName String

    The name of the stream

  • $state String | Array | Null

    can be "invited", "participating", "left", or an array, or null. If null, then it will return any

Returns:

Array:

getAllExtras

() Array

Returns:

Array:

The array of all extras set in the stream

getExtra

(
  • $extraName
  • $default
)
Mixed

Parameters:

  • $extraName String

    The name of the extra to get

  • $default Mixed

    The value to return if the extra is missing

Returns:

Mixed:

The value of the extra, or the default value, or null

getUsers

(
  • $publisherId
  • $streamName
  • [$options=array()]
)
Array

Get an array of users participating in the stream

Parameters:

  • $publisherId String
  • $streamName String
  • [$options=array()] Array optional

    Options to pass to the Db_Query->options method

Returns:

Array:

An array of user ids

setExtra

(
  • $extraName
  • $value
)

Parameters:

  • $extraName String

    The name of the extra to set, or an array of $extraName => $extraValue pairs

  • $value Mixed

    The value to set the extra to

Returns:

Streams_Participant

setUp

()

The setUp() method is called the first time an object of this class is constructed.

states

() Array static

Get the names of the possible states

Returns:

Array: