Show:

Streams_RelatedTo Class

Extends Base_Streams_RelatedTo
Module: Streams

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

Methods

__set_state

(
  • $array
)
Streams_RelatedTo

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

Parameters:

  • $array Array

Returns:

Streams_RelatedTo:

Class instance

clearExtra

(
  • $extraName
)

Parameters:

  • $extraName String

    The name of the extra to remove

fetchAll

(
  • $publisherId
  • $streamNames
  • $relationType
  • [$options=array()]
)
Array static

Fetch all the relations given multiple category streams, and sort them by ascending weight.

Parameters:

  • $publisherId String

    The publisher of the category streams

  • $streamNames Array

    Array of criteria to put for stream names, which can include strings, arrays, Db_Range or Db_Expression objects.

  • $relationType String | Array

    The type of the relation. Can also be an array of criteria corresponding to the $streamNames array.

  • [$options=array()] Array optional

    Options to apss to the Streams::related function. Can also include the following:

    • [asUserId] String optional

      Override the default user id to fetch streams as. Not used for now, since this function always fetches the relations only.

Returns:

Array:

An array of Streams_RelatedTo objects sorted by ascending weight.

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

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_RelatedTo

setUp

()

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