User:OliverCharles/ServerManual/Models

From MusicBrainz Wiki
Jump to navigationJump to search

Server Manual > Models

Within the Catalyst framework, models are the primary way to interact with data. This allows us to keep controllers abstract and also provides code reuse. Firstly, a bit about the models that we currently have - and how you can use them.

Current Models

MusicBrainz::Server::Model::Alias

load_for_entity $entity

MusicBrainz::Server::Model::Annotation

load_latest_annotation $entity

MusicBrainz::Server::Model::Artist

load $id

find_similar_artists $artist

MusicBrainz::Server::Model::CdToc

load_for_release $cdtoc

MusicBrainz::Server::Model::Documentation

fetch_page $page_id

MusicBrainz::Server::Model::Label

load $id

MusicBrainz::Server::Model::Relation

MusicBrainz::Server::Model::Release

find_linked_albums $entity

load $id

load_events $release

load_for_artist $artist, $all?

load_for_label $label

MusicBrainz::Server::Model::Tag

tog_tags $entity, $amount?

generate_tag_cloud $entity, $min_size?, $max_size, $bold_threshold?

MusicBrainz::Server::Model::Track

load $id

load_from_release $release

MusicBrainz::Server::Model::Url

load $id

Writing your own models

Feedback

This documentation is very alpha, and I'd really appreciate your feedback! Any comments, add it below, please sign it :)

  • Separate pages? I can see this page getting very large with all the models crapped together, should I split them into separate pages? -- OliverCharles 23:32, 26 July 2008 (UTC)