Show:

Streams_Access Class

Extends Base_Streams_Access
Module: Streams

Class representing 'Access' 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 access row in the Streams database.

Methods

__set_state

(
  • $array
)
Streams_Access

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

Parameters:

  • $array Array

Returns:

Streams_Access:

Class instance

addPermission

(
  • $permission
)

Parameters:

  • $permission String

afterRemoveExecute

(
  • $result
  • $query
)
Db_Result

Keeps Access table consistent on row deletion and update avatar

Parameters:

  • $result Db_Result

    Query result

  • $query Array

    The query which has been excecuted

Returns:

beforeSave

(
  • $value
)
Array

Check if one of ofUserId or ofContactLabel is set

Parameters:

  • $value Array

    The array of fields

Returns:

Array:

beforeSaveExecute

(
  • $query
  • $modifiedFields
  • $where
)
Db_Query

Keeps Access table consistent on row insert/update and update avatar

Parameters:

  • $query Db_Query

    The query being excecuted

  • $modifiedFields Array

    Modified fields

  • $where Array | Null

    Primary key value for existing row

Returns:

beforeSet_permissions

(
  • $value
)
Array

Method is called before setting the field and verifies that, if it is a string, it contains a JSON array.

Parameters:

  • $value String

Returns:

Array:

An array of field name and value

getAllPermissions

() Array

Returns:

Array:

hasPermission

(
  • $permission
)
Boolean

Parameters:

  • $permission String

Returns:

Boolean:

isTemplateOwner

(
  • $publisherId
  • $type
  • [$user=null]
)
Boolean static

Check if user "owns" a stream template for a publisher

Parameters:

  • $publisherId String
  • $type String
  • [$user=null] String | Users_User optional

Returns:

Boolean:

removePermission

(
  • $permission
)

Parameters:

  • $permission String

setUp

()

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