Represents the media:rating element specific to YouTube.

category Zend
package Zend_Gdata
subpackage YouTube
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Gdata_Extension

 Methods

Constructs a new MediaRating element

__construct(string $text = null, string $scheme = null, string $country = null
inherited_from \Zend_Gdata_Extension::__construct()

Parameters

$text

string

$scheme

string

$country

string

__construct()

__construct() 
Inherited

Magic getter to allow access like $entry->foo to call $entry->getFoo() Alternatively, if no getFoo() is defined, but a $_foo protected variable is defined, this is returned.

__get(string $name) 
Inherited

TODO Remove ability to bypass getFoo() methods??

Parameters

$name

string

The variable name sought

Magic __isset method

__isset(string $name) 
Inherited

Parameters

$name

string

Magic setter to allow acces like $entry->foo='bar' to call $entry->setFoo('bar') automatically.

__set(string $name, $val) 
Inherited

Alternatively, if no setFoo() is defined, but a $_foo protected variable is defined, this is returned.

TODO Remove ability to bypass getFoo() methods??

Parameters

$name

string

$val

Magic toString method allows using this directly via echo Works best in PHP >= 4.2.0

__toString() : string
Inherited

Returns

stringThe text representation of this object

Magic __unset method

__unset(string $name) 
Inherited

Parameters

$name

string

Alias for saveXML()

encode() : string
Inherited

Can be overridden by children to provide more complex representations of entries.

Returns

stringEncoded string content

Flush namespace lookup cache.

flushNamespaceLookupCache() 
InheritedStatic

Empties the namespace lookup cache. Call this function if you have added data to the namespace lookup table that contradicts values that may have been cached during a previous call to lookupNamespace().

getCountry()

getCountry() : string

Returns

string

Retrieves a DOMElement which corresponds to this element and all child properties. This is used to build an entry back into a DOM and eventually XML text for sending to the server upon updates, or for application storage/persistence.

getDOM(\DOMDocument $doc = null, $majorVersion = 1, $minorVersion = null) : \DOMElement

Parameters

$doc

\DOMDocument

The DOMDocument used to construct DOMElements

$majorVersion

$minorVersion

Returns

\DOMElementThe DOMElement representing this element and all child properties.

Retrieves a DOMElement which corresponds to this element and all child properties. This is used to build an entry back into a DOM and eventually XML text for sending to the server upon updates, or for application storage/persistence.

getDOM(\DOMDocument $doc = null, $majorVersion = 1, $minorVersion = null) : \DOMElement
Inherited

Parameters

$doc

\DOMDocument

The DOMDocument used to construct DOMElements

$majorVersion

$minorVersion

Returns

\DOMElementThe DOMElement representing this element and all child properties.

Returns an array of all extension attributes not transformed into data model properties during parsing of the XML. Each element of the array is a hashed array of the format: array('namespaceUri' => string, 'name' => string, 'value' => string);

getExtensionAttributes() : array
Inherited

Returns

arrayAll extension attributes

Returns an array of all elements not matched to data model classes during the parsing of the XML

getExtensionElements() : array
Inherited

Returns

arrayAll elements not matched to data model classes during parsing

getScheme()

getScheme() : string

Returns

string

Returns the child text node of this element This represents any raw text contained within the XML element

getText($trim = true) : string
Inherited

Parameters

$trim

Returns

stringChild text node

Alias for saveXML() returns XML content for this element and all children

getXML() : string
Inherited

Returns

stringXML content

Get the full version of a namespace prefix

lookupNamespace(string $prefix, integer $majorVersion = 1, integer $minorVersion = null) : string
Inherited

Looks up a prefix (atom:, etc.) in the list of registered namespaces and returns the full namespace URI if available. Returns the prefix, unmodified, if it's not registered.

Parameters

$prefix

string

The namespace prefix to lookup.

$majorVersion

integer

The major protocol version in effect. Defaults to '1'.

$minorVersion

integer

The minor protocol version in effect. Defaults to null (use latest).

Returns

string

Add an array of namespaces to the registered list.

registerAllNamespaces(array $namespaceArray) : void
Inherited

Takes an array in the format of: namespace prefix, namespace URI, major protocol version, minor protocol version and adds them with calls to ->registerNamespace()

Parameters

$namespaceArray

array

An array of namespaces.

Add a namespace and prefix to the registered list

registerNamespace(string $prefix, string $namespaceUri, integer $majorVersion = 1, integer $minorVersion = 0) : void
Inherited

Takes a prefix and a full namespace URI and adds them to the list of registered namespaces for use by $this->lookupNamespace().

WARNING: Currently, registering a namespace will NOT invalidate any memoized data stored in $_namespaceLookupCache. Under normal use, this behavior is acceptable. If you are adding contradictory data to the namespace lookup table, you must call flushNamespaceLookupCache().

Parameters

$prefix

string

The namespace prefix

$namespaceUri

string

The full namespace URI

$majorVersion

integer

The major protocol version in effect. Defaults to '1'.

$minorVersion

integer

The minor protocol version in effect. Defaults to null (use latest).

Converts this element and all children into XML text using getDOM()

saveXML() : string
Inherited

Returns

stringXML content

setCountry()

setCountry(string $value) : \Zend_Gdata_YouTube_Extension_MediaRating

Parameters

$value

string

Returns

\Zend_Gdata_YouTube_Extension_MediaRatingProvides a fluent interface

Sets an array of all extension attributes not transformed into data model properties during parsing of the XML. Each element of the array is a hashed array of the format: array('namespaceUri' => string, 'name' => string, 'value' => string); This can be used to add arbitrary attributes to any data model element

setExtensionAttributes(array $value) : \Zend_Gdata_App_Base
Inherited

Parameters

$value

array

All extension attributes

Returns

\Zend_Gdata_App_BaseReturns an object of the same type as 'this' to provide a fluent interface.

Sets an array of all elements not matched to data model classes during the parsing of the XML. This method can be used to add arbitrary child XML elements to any data model class.

setExtensionElements(array $value) : \Zend_Gdata_App_Base
Inherited

Parameters

$value

array

All extension elements

Returns

\Zend_Gdata_App_BaseReturns an object of the same type as 'this' to provide a fluent interface.

setScheme()

setScheme(string $value) : \Zend_Gdata_YouTube_Extension_MediaRating

Parameters

$value

string

Returns

\Zend_Gdata_YouTube_Extension_MediaRatingProvides a fluent interface

Sets the child text node of this element This represents any raw text contained within the XML element

setText(string $value) : \Zend_Gdata_App_Base
Inherited

Parameters

$value

string

Child text node

Returns

\Zend_Gdata_App_BaseReturns an object of the same type as 'this' to provide a fluent interface.

Transfers each child and attribute into member variables.

transferFromDOM(\DOMNode $node) 
Inherited

This is called when XML is received over the wire and the data model needs to be built to represent this XML.

Parameters

$node

\DOMNode

The DOMNode that represents this object's data

Parses the provided XML text and generates data model classes for each know element by turning the XML text into a DOM tree and calling transferFromDOM($element). The first data model element with the same name as $this->_rootElement is used and the child elements are recursively parsed.

transferFromXML(string $xml) 
Inherited

Parameters

$xml

string

The XML text to parse

Given a DOMNode representing an attribute, tries to map the data into instance members. If no mapping is defined, the name and value are stored in an array.

takeAttributeFromDOM(\DOMNode $attribute) 

Parameters

$attribute

\DOMNode

The DOMNode attribute needed to be handled

Given a DOMNode representing an attribute, tries to map the data into instance members. If no mapping is defined, the name and value are stored in an array.

takeAttributeFromDOM(\DOMNode $attribute) 
Inherited

Parameters

$attribute

\DOMNode

The DOMNode attribute needed to be handled

Given a child DOMNode, tries to determine how to map the data into object instance members. If no mapping is defined, Extension_Element objects are created and stored in an array.

takeChildFromDOM(\DOMNode $child) 
Inherited

Parameters

$child

\DOMNode

The DOMNode needed to be handled

 Properties

 

$_country

$_country : string

Default

null
 

Leftover attributes which were not handled

$_extensionAttributes : array

Default

array()
 

Leftover elements which were not handled

$_extensionElements : array

Default

array()
 

Memoized results from calls to lookupNamespace() to avoid expensive calls to getGreatestBoundedValue(). The key is in the form 'prefix-majorVersion-minorVersion', and the value is the output from getGreatestBoundedValue().

$_namespaceLookupCache : array

Default

array()
Static
 

List of namespaces, as a three-dimensional array. The first dimension represents the namespace prefix, the second dimension represents the minimum major protocol version, and the third dimension is the minimum minor protocol version. Null keys are NOT allowed.

$_namespaces : array

Default

array('atom' => array(1 => array(0 => 'http://www.w3.org/2005/Atom')), 'app' => array(1 => array(0 => 'http://purl.org/atom/app#'), 2 => array(0 => 'http://www.w3.org/2007/app')))

When looking up a namespace for a given prefix, the greatest version number (both major and minor) which is less than the effective version should be used.

see
see
see
 

$_rootElement

$_rootElement 

Default

'rating'
 

The XML element name, including prefix if desired

$_rootElement : string

Default

null
 

$_rootNamespace

$_rootNamespace 

Default

'media'
inherited_from \Zend_Gdata_Extension::_rootNamespace
 

The XML namespace prefix

$_rootNamespace : string

Default

'atom'
 

The XML namespace URI - takes precedence over lookup up the corresponding URI for $_rootNamespace

$_rootNamespaceURI : string

Default

null
 

$_scheme

$_scheme : string

Default

null
 

XML child text node content

$_text : string

Default

null