\Vigas\StreamingPlatforms\ModelMediasManager

Class MediasManager.

Manage Medias (streams or games )

Summary

Methods
Properties
Constants
setMediasArray()
addGames()
buildJsonFile()
setMediasArrayFromJSON()
getMediasToDisplay()
getMediasArray()
No public properties found
No constants found
oderByViewers()
$medias_to_display
$medias_array
N/A
No private methods found
No private properties found
N/A

Properties

$medias_to_display

$medias_to_display : array

Type

array — Contains medias to be displayed by the view

$medias_array

$medias_array : array

Type

array — Contains medias retrieved from the streaming platform

Methods

setMediasArray()

setMediasArray(array  $array) 

Merges existing medias array with medias retrieved from the streaming platform

Parameters

array $array

The media array retrieved from a streaming platform

addGames()

addGames(array  $games_array) 

Merges array if medias array is empty Adds numbers of viewers if the game is already in array or add the game if not

Parameters

array $games_array

buildJsonFile()

buildJsonFile(string  $path_file) 

Creates a JSON file with media_array data

Parameters

string $path_file

JSON file path

setMediasArrayFromJSON()

setMediasArrayFromJSON(string  $path_file) 

Sets medias_array from JSON file data

Parameters

string $path_file

JSON file path

getMediasToDisplay()

getMediasToDisplay(integer  $limit, integer  $offset, array  $source_array = null) 

Builds medias_to_display array to be displayed by the view

Parameters

integer $limit

Number of medias to display

integer $offset

Offset to start creating medias_to_display

array $source_array

Contains a list of streaming platforms (for streams only)

getMediasArray()

getMediasArray() : array

Returns

array —

Returns the media array