Author: ygrego Date: 2015-05-18 07:41:12 +0000 (Mon, 18 May 2015) New Revision: 1349 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1349 Log: -This class extends "Collection". -Implementation of method "addParentalRating". Added: oipf/js/impl/model/ParentalRatingCollection.js Added: oipf/js/impl/model/ParentalRatingCollection.js =================================================================== --- oipf/js/impl/model/ParentalRatingCollection.js (rev 0) +++ oipf/js/impl/model/ParentalRatingCollection.js 2015-05-18 07:41:12 UTC (rev 1349) @@ -0,0 +1,49 @@ +/* + * typedef Collection<ParentalRating> ParentalRatingCollection + * A ParentalRatingCollection represents a collection of parental rating values. + * See Annex K for the definition of the collection template. In addition to + * the methods and properties defined for generic collections, + * the ParentalRatingCollection class supports the additional properties and + * methods defined below. + */ + +var ParentalRatingCollection = Collection.extend({ + + init: function() { + this.super.init.apply(this, arguments); + }, + + /* + * Description: + * Creates a ParentalRating object instance for a given parental rating + * scheme and parental rating value, and adds it to + * the ParentalRatingCollection for a programme or channel. + * + * Arguments: + * - scheme A unique string identifying the parental rating scheme to which + * this value refers. See property scheme in section 7.9.4.1 for more + * information about possible values. + * + * -name: A string representation of the parental rating value. See property + * name in section 7.9.4.1 for more information about possible values. + * Values are not case sensitive. + * + * -value: The parental rating value represented as an Integer. See property + * value in section 7.9.4.1 for more information about possible values. + * + * -labels: A set of content rating labels that may provide additional + * information about the rating. See property labels in section 7.9.4.1 for + * more information about possible values.- region: The region to which the + * parental rating value applies as an alpha-2 region code as defined in + * ISO 3166-1. The value of this argument must be null or undefined if no + * specific region has been identified. Values are not case sensitive. + */ + addParentalRating: function(scheme, name, value, labels, region) { + var newParentalRating = + new ParentalRating(scheme, name, value, labels, region); + + this.push(newParentalRating); + } +}); + +