Gdata/YouTube/Extension/MediaGroup.php

Show: inherited
Table of Contents

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Gdata  
Subpackage
YouTube  
Version
$Id: MediaGroup.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Gdata_YouTube_Extension_MediaGroup

Package: Zend\Gdata\YouTube

This class represents the media:group element of Media RSS.

It allows the grouping of media:content elements that are different representations of the same content. When it exists, it is a child of an Entry (Atom) or Item (RSS).

Parent(s)
\Zend_Gdata_Media_Extension_MediaGroup < \Zend_Gdata_Extension < \Zend_Gdata_App_Extension < \Zend_Gdata_App_Base
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

Propertyprotectedarray $_category = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Gdata_Media_Extension_MediaGroup::$$_category  
Propertyprotectedarray $_content = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Gdata_Media_Extension_MediaGroup::$$_content  
Propertyprotected\Zend_Gdata_Media_Extension_MediaCopyright $_copyright = null
Propertyprotectedarray $_credit = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Gdata_Media_Extension_MediaGroup::$$_credit  
Propertyprotected\Zend_Gdata_Media_Extension_MediaDescription $_description = null
Propertyprotected\Zend_Gdata_YouTube_Extension_Duration $_duration = null

Default valuenullDetails
Type
\Zend_Gdata_YouTube_Extension_Duration
Propertyprotectedarray $_hash = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Gdata_Media_Extension_MediaGroup::$$_hash  
Propertyprotected\Zend_Gdata_Media_Extension_MediaKeywords $_keywords = null
Propertyprotectedarray $_mediaText = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Gdata_Media_Extension_MediaGroup::$$_mediaText  
Propertyprotected\Zend_Gdata_YouTube_Extension_MediaCredit $_mediacredit = null

Default valuenullDetails
Type
\Zend_Gdata_YouTube_Extension_MediaCredit
Propertyprotected\Zend_Gdata_YouTube_Extension_MediaRating $_mediarating = null

Default valuenullDetails
Type
\Zend_Gdata_YouTube_Extension_MediaRating
Propertyprotectedarray $_namespaceLookupCache = array()
staticinherited<p>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().</p>

Inherited from: \Zend_Gdata_App_Base::$$_namespaceLookupCache\Zend_Gdata_App_Extension::$$_namespaceLookupCache\Zend_Gdata_Extension::$$_namespaceLookupCache\Zend_Gdata_Media_Extension_MediaGroup::$$_namespaceLookupCache
Propertyprotectedarray $_namespaces = 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')))

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.

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.

Default valuearray('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')))Details
Type
array
Inherited_from
\Zend_Gdata_App_Base::$$_namespaces  
Inherited_from
\Zend_Gdata_App_Extension::$$_namespaces  
Inherited_from
\Zend_Gdata_Extension::$$_namespaces  
Inherited_from
\Zend_Gdata_Media_Extension_MediaGroup::$$_namespaces  
See
\global\lookupNamespace()  
See
\global\registerNamespace()  
See
\global\registerAllNamespaces()  
Propertyprotectedarray $_player = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Gdata_Media_Extension_MediaGroup::$$_player  
Propertyprotected\Zend_Gdata_YouTube_Extension_Private $_private = null

Default valuenullDetails
Type
\Zend_Gdata_YouTube_Extension_Private
Propertyprotectedarray $_rating = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Gdata_Media_Extension_MediaGroup::$$_rating  
Propertyprotectedarray $_restriction = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Gdata_Media_Extension_MediaGroup::$$_restriction  
Propertyprotectedstring $_rootElement = 'group'

<p>The XML element name, including prefix if desired</p>
Default value'group'Details
Type
string
Propertyprotectedstring $_rootNamespace = 'media'

<p>The XML namespace prefix</p>
Default value'media'Details
Type
string
Propertyprotectedstring $_rootNamespaceURI = null
inherited<p>The XML namespace URI - takes precedence over lookup up the corresponding URI for $_rootNamespace</p>

Inherited from: \Zend_Gdata_App_Base::$$_rootNamespaceURI\Zend_Gdata_App_Extension::$$_rootNamespaceURI\Zend_Gdata_Extension::$$_rootNamespaceURI\Zend_Gdata_Media_Extension_MediaGroup::$$_rootNamespaceURI
Propertyprotectedstring $_text = null
Default valuenullDetails
Type
string
Inherited_from
\Zend_Gdata_App_Base::$$_text  
Inherited_from
\Zend_Gdata_App_Extension::$$_text  
Inherited_from
\Zend_Gdata_Extension::$$_text  
Inherited_from
\Zend_Gdata_Media_Extension_MediaGroup::$$_text  
Propertyprotectedarray $_thumbnail = array()
Default valuearray()Details
Type
array
Inherited_from
\Zend_Gdata_Media_Extension_MediaGroup::$$_thumbnail  
Propertyprotectedstring $_title = null
Default valuenullDetails
Type
string
Inherited_from
\Zend_Gdata_Media_Extension_MediaGroup::$$_title  
Propertyprotected\Zend_Gdata_YouTube_Extension_Uploaded $_uploaded = null

Default valuenullDetails
Type
\Zend_Gdata_YouTube_Extension_Uploaded
Propertyprotected\Zend_Gdata_YouTube_Extension_VideoId $_videoid = null

Default valuenullDetails
Type
\Zend_Gdata_YouTube_Extension_VideoId

Methods

methodpublic__construct( $element = null) : void

Creates an individual MediaGroup object.

Parameters
Name Type Description
$element
methodpublic__get(string $name) : void
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.

Inherited from: \Zend_Gdata_App_Base::__get()\Zend_Gdata_App_Extension::__get()\Zend_Gdata_Extension::__get()\Zend_Gdata_Media_Extension_MediaGroup::__get()

TODO Remove ability to bypass getFoo() methods??

Parameters
Name Type Description
$name string

The variable name sought

methodpublic__isset(string $name) : void
Parameters
Name Type Description
$name string
methodpublic__set(string $name,  $val) : void
inherited

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

Inherited from: \Zend_Gdata_App_Base::__set()\Zend_Gdata_App_Extension::__set()\Zend_Gdata_Extension::__set()\Zend_Gdata_Media_Extension_MediaGroup::__set()

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 Type Description
$name string
$val
methodpublic__toString() : string
inherited

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

Inherited from: \Zend_Gdata_App_Base::__toString()\Zend_Gdata_App_Extension::__toString()\Zend_Gdata_Extension::__toString()\Zend_Gdata_Media_Extension_MediaGroup::__toString()
Returns
Type Description
string The text representation of this object
methodpublic__unset(string $name) : void
Parameters
Name Type Description
$name string
methodpublicencode() : string

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

Returns
Type Description
string Encoded string content
methodpublicflushNamespaceLookupCache() : void

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().

methodpublicgetCategory() : array
Returns
Type Description
array
methodpublicgetContent() : array
Returns
Type Description
array
methodpublicgetCredit() : array
Returns
Type Description
array
methodpublicgetDOM(\DOMDocument $doc = null,  $majorVersion = 1,  $minorVersion = null) : \DOMElement

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.

Parameters
Name Type Description
$doc \DOMDocument

The DOMDocument used to construct DOMElements

$majorVersion
$minorVersion
Returns
Type Description
\DOMElement The DOMElement representing this element and all child properties.
methodpublicgetDuration() : \Zend_Gdata_YouTube_Extension_Duration

Returns the duration value of this element

Returns
Type Description
\Zend_Gdata_YouTube_Extension_Duration
methodpublicgetExtensionAttributes() : array
inherited

Returns an array of all extension attributes not transformed into data model properties during parsing of the XML.

Inherited from: \Zend_Gdata_App_Base::getExtensionAttributes()\Zend_Gdata_App_Extension::getExtensionAttributes()\Zend_Gdata_Extension::getExtensionAttributes()\Zend_Gdata_Media_Extension_MediaGroup::getExtensionAttributes()

Each element of the array is a hashed array of the format: array('namespaceUri' => string, 'name' => string, 'value' => string);

Returns
Type Description
array All extension attributes
methodpublicgetExtensionElements() : array
Returns
Type Description
array All elements not matched to data model classes during parsing
methodpublicgetHash() : array
Returns
Type Description
array
methodpublicgetMediaCredit() : \Zend_Gdata_YouTube_Extension_MediaCredit

Returns the media:credit value of this element

methodpublicgetMediaRating() : \Zend_Gdata_YouTube_Extension_MediaRating

Returns the rating value of this element

methodpublicgetMediaText() : array
Returns
Type Description
array
methodpublicgetPlayer() : array
Returns
Type Description
array
methodpublicgetPrivate() : \Zend_Gdata_YouTube_Extension_Private

Returns the private value of this element

Returns
Type Description
\Zend_Gdata_YouTube_Extension_Private
methodpublicgetRating() : array
Returns
Type Description
array
methodpublicgetRestriction() : array
Returns
Type Description
array
methodpublicgetText( $trim = true) : string
inherited

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

Inherited from: \Zend_Gdata_App_Base::getText()\Zend_Gdata_App_Extension::getText()\Zend_Gdata_Extension::getText()\Zend_Gdata_Media_Extension_MediaGroup::getText()
Parameters
Name Type Description
$trim
Returns
Type Description
string Child text node
methodpublicgetThumbnail() : array
Returns
Type Description
array
methodpublicgetUploaded() : \Zend_Gdata_YouTube_Extension_Uploaded

Returns the yt:uploaded element

Returns
Type Description
\Zend_Gdata_YouTube_Extension_Uploaded
methodpublicgetVideoId() : \Zend_Gdata_YouTube_Extension_VideoId

Returns the videoid value of this element

Returns
Type Description
\Zend_Gdata_YouTube_Extension_VideoId
methodpublicgetXML() : string
inherited

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

Inherited from: \Zend_Gdata_App_Base::getXML()\Zend_Gdata_App_Extension::getXML()\Zend_Gdata_Extension::getXML()\Zend_Gdata_Media_Extension_MediaGroup::getXML()
Returns
Type Description
string XML content
methodpubliclookupNamespace(string $prefix, integer $majorVersion = 1, integer $minorVersion = null) : string

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
Name Type Description
$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
Type Description
string
methodpublicregisterAllNamespaces(array $namespaceArray) : void

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
Name Type Description
$namespaceArray array

An array of namespaces.

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

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
Name Type Description
$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).

methodpublicsaveXML() : string
Returns
Type Description
string XML content
methodpublicsetCategory(array $value) : \Zend_Gdata_Media_Extension_MediaGroup
Parameters
Name Type Description
$value array
Returns
Type Description
\Zend_Gdata_Media_Extension_MediaGroup
methodpublicsetContent(array $value) : \Zend_Gdata_Media_MediaGroup
Parameters
Name Type Description
$value array
Returns
Type Description
\Zend_Gdata_Media_MediaGroup Provides a fluent interface
methodpublicsetCredit(array $value) : \Zend_Gdata_Media_Extension_MediaGroup
Parameters
Name Type Description
$value array
Returns
Type Description
\Zend_Gdata_Media_Extension_MediaGroup
methodpublicsetDuration(\Zend_Gdata_YouTube_Extension_Duration $value) : \Zend_Gdata_YouTube_Extension_MediaGroup

Sets the duration value of this element

Parameters
Name Type Description
$value \Zend_Gdata_YouTube_Extension_Duration

The duration value

Returns
Type Description
\Zend_Gdata_YouTube_Extension_MediaGroup Provides a fluent interface
methodpublicsetExtensionAttributes(array $value) : \Zend_Gdata_App_Base
inherited

Sets an array of all extension attributes not transformed into data model properties during parsing of the XML.

Inherited from: \Zend_Gdata_App_Base::setExtensionAttributes()\Zend_Gdata_App_Extension::setExtensionAttributes()\Zend_Gdata_Extension::setExtensionAttributes()\Zend_Gdata_Media_Extension_MediaGroup::setExtensionAttributes()

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

Parameters
Name Type Description
$value array

All extension attributes

Returns
Type Description
\Zend_Gdata_App_Base Returns an object of the same type as 'this' to provide a fluent interface.
methodpublicsetExtensionElements(array $value) : \Zend_Gdata_App_Base

This method can be used to add arbitrary child XML elements to any data model class.

Parameters
Name Type Description
$value array

All extension elements

Returns
Type Description
\Zend_Gdata_App_Base Returns an object of the same type as 'this' to provide a fluent interface.
methodpublicsetHash(array $value) : \Zend_Gdata_Media_Extension_MediaGroup
Parameters
Name Type Description
$value array
Returns
Type Description
\Zend_Gdata_Media_Extension_MediaGroup
methodpublicsetKeywords(array $value) : \Zend_Gdata_Media_Extension_MediaGroup
Parameters
Name Type Description
$value array
Returns
Type Description
\Zend_Gdata_Media_Extension_MediaGroup Provides a fluent interface
methodpublicsetMediaCredit(\Zend_Gdata_YouTube_Extension_MediaCredit $value) : \Zend_Gdata_YouTube_Extension_MediaGroup

Sets the media:credit value of this element

Parameters
Name Type Description
$value \Zend_Gdata_YouTube_Extension_MediaCredit

The credit element

Returns
Type Description
\Zend_Gdata_YouTube_Extension_MediaGroup Provides a fluent interface
methodpublicsetMediaRating(\Zend_Gdata_YouTube_Extension_MediaRating $value) : \Zend_Gdata_YouTube_Extension_MediaGroup

Sets the media:rating value of this element

Parameters
Name Type Description
$value \Zend_Gdata_YouTube_Extension_MediaRating

The rating element

Returns
Type Description
\Zend_Gdata_YouTube_Extension_MediaGroup Provides a fluent interface
methodpublicsetMediaText( $value) : \Zend_Gdata_Media_Extension_MediaGroup
Parameters
Name Type Description
$value

array

Returns
Type Description
\Zend_Gdata_Media_Extension_MediaGroup
methodpublicsetPlayer( $value) : \Zend_Gdata_Media_Extension_MediaGroup
Parameters
Name Type Description
$value

array

Returns
Type Description
\Zend_Gdata_Media_Extension_MediaGroup
methodpublicsetPrivate(\Zend_Gdata_YouTube_Extension_Private $value) : \Zend_Gdata_YouTube_Extension_MediaGroup

Sets the private value of this element

Parameters
Name Type Description
$value \Zend_Gdata_YouTube_Extension_Private

The private value

Returns
Type Description
\Zend_Gdata_YouTube_Extension_MediaGroup Provides a fluent interface
methodpublicsetRating( $value) : \Zend_Gdata_Media_Extension_MediaGroup
Parameters
Name Type Description
$value

array

Returns
Type Description
\Zend_Gdata_Media_Extension_MediaGroup
methodpublicsetRestriction( $value) : \Zend_Gdata_Media_Extension_MediaGroup
Parameters
Name Type Description
$value

array

Returns
Type Description
\Zend_Gdata_Media_Extension_MediaGroup
methodpublicsetText(string $value) : \Zend_Gdata_App_Base
inherited

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

Inherited from: \Zend_Gdata_App_Base::setText()\Zend_Gdata_App_Extension::setText()\Zend_Gdata_Extension::setText()\Zend_Gdata_Media_Extension_MediaGroup::setText()
Parameters
Name Type Description
$value string

Child text node

Returns
Type Description
\Zend_Gdata_App_Base Returns an object of the same type as 'this' to provide a fluent interface.
methodpublicsetThumbnail( $value) : \Zend_Gdata_Media_Extension_MediaGroup
Parameters
Name Type Description
$value

array

Returns
Type Description
\Zend_Gdata_Media_Extension_MediaGroup
methodpublicsetUploaded(\Zend_Gdata_YouTube_Extension_Uploaded $value) : \Zend_Gdata_YouTube_Extension_MediaGroup

Sets the yt:uploaded element

Parameters
Name Type Description
$value \Zend_Gdata_YouTube_Extension_Uploaded

The uploaded value

Returns
Type Description
\Zend_Gdata_YouTube_Extension_MediaGroup Provides a fluent interface
methodpublicsetVideoId(\Zend_Gdata_YouTube_Extension_VideoId $value) : \Zend_Gdata_YouTube_Extension_MediaGroup

Sets the videoid value of this element

Parameters
Name Type Description
$value \Zend_Gdata_YouTube_Extension_VideoId

The video id value

Returns
Type Description
\Zend_Gdata_YouTube_Extension_MediaGroup Provides a fluent interface
methodprotectedtakeAttributeFromDOM(\DOMNode $attribute) : void

If no mapping is defined, the name and value are stored in an array.

Parameters
Name Type Description
$attribute \DOMNode

The DOMNode attribute needed to be handled

methodprotectedtakeChildFromDOM(\DOMNode $child) : void

Creates individual Entry objects of the appropriate type and stores them in the $_entry array based upon DOM data.

If no mapping is defined, Extension_Element objects are created and stored in an array.

Parameters
Name Type Description
$child \DOMNode

The DOMNode to process

methodpublictransferFromDOM(\DOMNode $node) : void

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

Parameters
Name Type Description
$node \DOMNode

The DOMNode that represents this object's data

methodpublictransferFromXML(string $xml) : void
inherited

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).

Inherited from: \Zend_Gdata_App_Base::transferFromXML()\Zend_Gdata_App_Extension::transferFromXML()\Zend_Gdata_Extension::transferFromXML()\Zend_Gdata_Media_Extension_MediaGroup::transferFromXML()

The first data model element with the same name as $this->_rootElement is used and the child elements are recursively parsed.

Parameters
Name Type Description
$xml string

The XML text to parse

Documentation was generated by phpDocumentor 2.0.0a8.