OpenBroadcaster Documentation
models / mediacategories_model.php

MediaCategoriesModel

Model

Secondary model for managing media categories.

public  search ( filters, orderby, orderdesc, limit, offset )

Search media categories.

Parameters
filters
orderby
orderdesc
limit
offset
Returns [id, name]
public  save ( data, id=false )

Save a media category.

Parameters
data
id Optional. Specified when editing a pre-existing category.
Returns id
public  get_default ( )

Get the default media category. Returns FALSE if no default category is set.

Returns default_category
public  validate ( data, id=false )

Validate a category before updating or inserting.

Parameters
data
id Optional. Specified when updating an existing category.
Returns is_valid
public  can_delete ( id )

Check whether a category can be deleted. Makes sure that all genres within the category are deleted first.

Parameters
id
Returns is_deletable
public  delete ( id )

Delete a category.

Parameters
id
public  get_by_id ( id )

Get the category name and whether or not it's the default category by ID.

Parameters
id
Returns [id, name, is_default]