Streams_Invite Class
Class representing 'Invite' 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 invite row in the Streams database.
Item Index
Methods
- __set_state
- accept
- beforeSave
- beforeSave
- forStream static
- getInvite static
- setUp
Events
Methods
__set_state
-
$array
Implements the __set_state method, so it can work with with var_export and be re-imported successfully.
Parameters:
-
$array
Array
Returns:
Class instance
accept
-
$options
Accept the invite and set up user's access levels If invite was already accepted, this function simply returns null
Parameters:
-
$options
ArrayThings to do with the logged-in user
-
[subscribe=false]
Boolean optionalWhether to auto-subscribe them to the stream if not already subscribed. If the subscribe() call throws an exception, it is swallowed.
-
[access=true]
Boolean optionalWhether to upgrade their access to the stream
-
Returns:
beforeSave
-
$modifiedFields
Assigns unique id to 'token' field if not set Saves corresponding row in Streams_Invited table Inserting a new invite affects corresponding row in Streams_Participant table
Parameters:
-
$modifiedFields
ArrayThe fields that have been modified
Returns:
beforeSave
-
$pk
Also removes counterpart row in Streams_Invited table
Parameters:
-
$pk
ArrayThe primary key fields
Returns:
forStream
-
$publisherId
-
$streamName
-
$userId
Get the invites that have been left for one or more users in some stream. This is useful for auto-accepting them or presenting the user with a button to accept the invite when the stream is rendered on their client.
Parameters:
-
$publisherId
String -
$streamName
String | Array | Db_Expression -
$userId
String | Array | Db_Expression
Returns:
an array of Streams_Invite objects, or if $streamName and $userId are strings, just returns Streams_Invite or null.
getInvite
-
$token
-
$throwIfMissing
Retrieves invite
Parameters:
-
$token
String -
$throwIfMissing
Boolean
Returns:
setUp
()
The setUp() method is called the first time an object of this class is constructed.