Documentation

Author
in package

Author library.

Tags
author

Farottone

OA\Schema

( schema="Author", title="Author", @OA\Xml( name="Author library" ) )

Table of Contents

$account  : string
$active  : bool
$author_class  : string
$avatar_path  : string
$data  : mixed
$dl_count  : int
$full_stats  : bool
$level  : int
$magma_id  : int
$member_id  : int
$name  : string
$newsongs_read  : bool
$role  : string
$shortname  : string
$song_count  : int
$modelAuthorData  : mixed
__construct()  : mixed
accepted_license()  : mixed
add_follower()  : mixed
avatar()  : mixed
dashboardData()  : mixed
established()  : mixed
follow_update()  : mixed
followed()  : mixed
followed_authors()  : mixed
followers()  : mixed
is_current_author()  : mixed
isAdmin()  : mixed
isC3X()  : mixed
isC3XAdmin()  : mixed
isC3XAuthor()  : mixed
new_songs()  : mixed
page()  : mixed
public_profile()  : mixed
remove_follower()  : mixed
shortname()  : mixed
shortnameByName()  : mixed
validateminDate()  : mixed
_modelAuthorData()  : array<string|int, mixed>
Author data model Stores all fields from the DB that become properties We can also serve this fields in an object or array
data()  : array<string|int, mixed>
Serves author data

Properties

$account

public string $account
Tags
OA\Property

( description="Account level for this author. See /accounts for a complete list.", )

$active

public bool $active
Tags
OA\Property

( description="TRUE when the author has logged in at least once", )

$author_class

public string $author_class
Tags
OA\Property

( description="Author class level, a ranking system based on number of downloads of their songs and number of songs published. It can be different from level because the class can be hard-coded for example for Founder role. See /accounts for a complete list", )

$avatar_path

public string $avatar_path
Tags
OA\Property

( description="Path to local avatar image. This will probably be deprecated in the future in favor of an API endpoint.", )

$dl_count

public int $dl_count
Tags
OA\Property

( description="Number of downloads of songs released", )

$full_stats

public bool $full_stats
Tags
OA\Property

( description="TRUE when we show this author's complete set of stats. Might be deprecated", )

$level

public int $level
Tags
OA\Property

( description="Author class level ID, a ranking system based on number of downloads of their songs and number of songs published. level is purely based on stats, as opposed to author_class. See /accounts for a complete list", )

$magma_id

public int $magma_id
Tags
OA\Property

( description="Sequential number used as internal ID for tables requiring numerical ID for the author", )

$member_id

public int $member_id
Tags
OA\Property

( title="member_id", description="Sequential number used as internal ID for tables requiring numerical ID for the author", )

$name

public string $name
Tags
OA\Property

( description="Author's username. It can be changed without breaking anything.", )

$newsongs_read

public bool $newsongs_read
Tags
OA\Property

( description="TRUE when we mark the author as having read all notifications for new songs published by authors he follows" )

$role

public string $role
Tags
OA\Property

( description="Describers the author's role. Might be deprecated in the future if we separate authors and users in different tables", enum={"user", "admin"} )

$shortname

public string $shortname
Tags
OA\Property

( description="Slugified username, also used as author ID. It cannot be changed.", )

$song_count

public int $song_count
Tags
OA\Property

( description="Number of songs released", )

$modelAuthorData

private static mixed $modelAuthorData = array("member_id" => "public", "magma_id" => "private", "name" => "public", "account" => "public", "avatar_path" => "public", "shortname" => "public", "level" => "public", "author_class" => "public", "active" => "private", "song_count" => "public", "dl_count" => "public", "full_stats" => "public", "role" => "public", "newsongs_read" => "private", "c3" => "private", "c3xrole" => "private", "author_c3xskills" => "private", "color" => "private", "c3xmanagedby" => "private", "c3xagreement" => "private", "c3xskills" => "private")

Methods

__construct()

public __construct(mixed $myuser[, mixed $scope = false ]) : mixed
Parameters
$myuser : mixed
$scope : mixed = false
Return values
mixed

accepted_license()

public accepted_license(mixed $author) : mixed
Parameters
$author : mixed
Return values
mixed

add_follower()

public add_follower(mixed $user, mixed $author) : mixed
Parameters
$user : mixed
$author : mixed
Return values
mixed

avatar()

public avatar(mixed $author) : mixed
Parameters
$author : mixed
Return values
mixed

dashboardData()

public dashboardData() : mixed
Return values
mixed

established()

public established() : mixed
Return values
mixed

follow_update()

public follow_update(mixed $author) : mixed
Parameters
$author : mixed
Return values
mixed

followed()

public followed(mixed $user, mixed $author) : mixed
Parameters
$user : mixed
$author : mixed
Return values
mixed

followed_authors()

public followed_authors(mixed $user) : mixed
Parameters
$user : mixed
Return values
mixed

followers()

public followers(mixed $author[, mixed $user = false ]) : mixed
Parameters
$author : mixed
$user : mixed = false
Return values
mixed

is_current_author()

public is_current_author(mixed $author) : mixed
Parameters
$author : mixed
Return values
mixed

isAdmin()

public isAdmin([mixed $author = false ]) : mixed
Parameters
$author : mixed = false
Return values
mixed

isC3X()

public isC3X([mixed $author = false ]) : mixed
Parameters
$author : mixed = false
Return values
mixed

isC3XAdmin()

public isC3XAdmin([mixed $author = false ]) : mixed
Parameters
$author : mixed = false
Return values
mixed

isC3XAuthor()

public isC3XAuthor([mixed $author = false ]) : mixed
Parameters
$author : mixed = false
Return values
mixed

new_songs()

public new_songs(mixed $date) : mixed
Parameters
$date : mixed
Return values
mixed

page()

public page() : mixed
Return values
mixed

public_profile()

public public_profile() : mixed
Return values
mixed

remove_follower()

public remove_follower(mixed $user, mixed $author) : mixed
Parameters
$user : mixed
$author : mixed
Return values
mixed

shortname()

public shortname(mixed $memberid) : mixed
Parameters
$memberid : mixed
Return values
mixed

shortnameByName()

public shortnameByName(mixed $fullname) : mixed
Parameters
$fullname : mixed
Return values
mixed

validateminDate()

public validateminDate(mixed $when) : mixed
Parameters
$when : mixed
Return values
mixed

_modelAuthorData()

Author data model Stores all fields from the DB that become properties We can also serve this fields in an object or array

private static _modelAuthorData([mixed $options = false ]) : array<string|int, mixed>
Parameters
$options : mixed = false
Tags
options

scope string : full|public|private Dictates which fields to serve Only a limited amount of fields are for public consumption Defaults to public, full|private are only available to admins WARNING: there is no admin check here, make sure to require the correct scope

Return values
array<string|int, mixed>

data()

Serves author data

private data([mixed $options = false ]) : array<string|int, mixed>
Parameters
$options : mixed = false
Tags
options

scope string : full|public|private Dictates which fields to serve Only a limited amount of fields are for public consumption Defaults to public, full|private are only available to admins WARNING: there is no admin check here, make sure to require the correct scope

Return values
array<string|int, mixed>

Search results