Class Components - echiong/testRepo GitHub Wiki

##Class Components

Components class handles generic operations related to all component types.

Package: [[application<a href="Package application.controlllers.md">controlllers]]
Extends: Framework_controller
Located at application/controllers/components.php

##Methods summary


public __construct ( )


public string do_upload ( )

End-point method called for Featurings audio file upload.

Returns string
Returns ok[file_name] on success or an error message on failure.

Uses Audioupload_lib::do_upload()


public string delete ( )

Components delete endpoint.

Returns string
Returns ok on success or an error message on failure.

Uses Comments_model::delete_by_components() Components_model::delete() Components_model::decrement_stat() CommercialContent_model::delete() SeenContent_model::delete_by_component()


public record_play ( string $type = 'Beat', integer $id = null )

Endpoint to increment seencontent stats.

Parameters

$type string
$type Component type.

$id integer
$id Component record id.

Uses Components_model::get() Components_model::increment_stat() SeenContent_model::create()


public seen_lyrics ( integer $id )

Endpoint to increment seencontent stat specific to lyrics.

Parameters

$id integer
$id Lyrics record id.

Uses SeenContent_model::create()


public mine ( string $subquery = '_', string $type = 'feats' )

Displays components which is owned by a user.

Parameters

$subquery string
$subquery Pass a subquery (currently unused)

$type string
$type Component type


public string comment ( integer $feat_id, string $type = 'feats' )

Endpoint to handle comment entries.

Parameters

$feat_id integer
$feat_id Component record id

$type string
$type Component type

Returns string
Returns ok on success or an error message on failure.

Uses Comments_model::create(),-Notifications_model::from(), Notifications_model::to(),-Notifications_model::create()


public get_list ( string $component, integer $offset = 0, integer $limit = 100 )

Displays a list of components.

Parameters

$component string
$component Component type.

$offset integer
$offset A numeric offset value.

$limit integer
$limit A numeric limit value.

Uses Components_model::get() Components_model::get_list()

⚠️ **GitHub.com Fallback** ⚠️