Gdata/App/FeedEntryParent.php
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 license@zend.com so we can send you a copy
immediately.
- category
- Zend
- copyright
- Copyright (c) 2005-2011 Zend Technologies USA Inc.
(http://www.zend.com)
- license
- New
BSD License
- package
- Zend_Gdata
- subpackage
- App
- version
- $Id: FeedEntryParent.php 23775 2011-03-01 17:25:24Z ralph $
\Zend_Gdata_App_FeedEntryParent
Abstract class for common functionality
in entries and feeds
- Extends from
- \Zend_Gdata_App_Base
- category
- Zend
- copyright
- Copyright (c) 2005-2011 Zend Technologies USA Inc.
(http://www.zend.com)
- license
- New
BSD License
- package
- Zend_Gdata
- subpackage
- App
Properties



string|null $_etag=
'NULL'
The HTTP ETag associated with this
entry. Used for optimistic concurrency in protoco v2 or greater.
Default valueNULL
Details
- Type
- stringnull



$_majorProtocolVersion=
'1'
Indicates the major protocol version
that should be used.
At present, recognized values are either 1 or 2. However, any
integer value >= 1 is considered valid.
Default value1
Details
- Type
- see
- \setMajorProtocolVersion()
- see
- \getMajorProtocolVersion()



$_minorProtocolVersion=
'null'
Indicates the minor protocol version
that should be used. Can be set to either an integer >= 0, or NULL if
no minor version should be sent to the server.
Default valuenull
Details
- Type
- see
- \setMinorProtocolVersion()
- see
- \getMinorProtocolVersion()



$_service=
'null'
Service instance used to make network
requests.
Default valuenull
Details
- Type
- see
- \setService(),
Methods



__construct( $element = null ) : void
Constructs a Feed or Entry
Parameters
Name |
Type |
Description |
$element |
|
|



__get( string $name ) : void
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()
TODO Remove ability to bypass getFoo() methods??
Parameters
Name |
Type |
Description |
$name |
string |
The variable name sought |



getAlternateLink( ) : \Zend_Gdata_App_Extension_Link
Returns the
Zend_Gdata_App_Extension_Link element which represents the URL for an
alternate view of the data represented by this feed or entry. This
alternate view is commonly a user-facing webpage, blog post, etc. The
MIME type for the data at the URL is available from the returned
Zend_Gdata_App_Extension_Link element.
This link is in the atom feed/entry as an atom:link with a rel
attribute value of 'self'.
Returns



getCategory( ) : array
Returns the array of categories that
classify this feed/entry. Each category is represented in an atom feed
by an atom:category element.
Returns
Type |
Description |
array |
Array of Zend_Gdata_App_Extension_Category |



getContributor( ) : array
Returns the array of contributors to
this feed/entry. Each contributor is represented in an atom feed by an
atom:contributor XML element
Returns
Type |
Description |
array |
An array of Zend_Gdata_App_Extension_Contributor |



getDOM( \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. |



getEtag( ) : string|null
Return the Etag for the current entry,
or null if not set.
Returns
Type |
Description |
stringnull |
|



getExtensionAttributes( ) : array
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);
Inherited from: \Zend_Gdata_App_Base::getExtensionAttributes()
Returns
Type |
Description |
array |
All extension attributes |



getHttpClient( ) : \Zend_Http_Client_Abstract
Gets the HTTP client object. If none is
set, a new Zend_Http_Client will be used.
Returns
Type |
Description |
\Zend_Http_Client_Abstract |
|
Details
- deprecated
- Deprecated as of Zend Framework 1.7. Use getService() instead.



getLink( string $rel = null ) : mixed
Given a particular 'rel' value, this
method returns a matching Zend_Gdata_App_Extension_Link element. If the
'rel' value is not provided, the full array of
Zend_Gdata_App_Extension_Link elements is returned. In an atom feed,
each link is represented by an atom:link element. The 'rel' value passed
to this function is the atom:link/@rel attribute. Example rel values
include 'self', 'edit', and 'alternate'.
Parameters
Name |
Type |
Description |
$rel |
string |
The rel value of the link to be found. If null, the
array of Zend_Gdata_App_Extension_link elements is returned |
Returns
Type |
Description |
mixed |
Either a single Zend_Gdata_App_Extension_link element, an
array of the same or null is returned depending on the rel value
supplied as the argument to this function |



getMajorProtocolVersion( ) : \(int|\NULL)
Get the major protocol version that is
in use.
Returns
Type |
Description |
\(int\NULL) |
The major protocol version in use. |
Details
- see
- \_majorProtocolVersion



getMinorProtocolVersion( ) : \(int|\NULL)
Get the minor protocol version that is
in use.
Returns
Type |
Description |
\(int\NULL) |
The major protocol version in use, or NULL if no minor
version is specified. |
Details
- see
- \_minorProtocolVersion



getService( ) : \Zend_Gdata_App|null
Get the active service instance for
this object. This will be used to perform network requests, such as when
calling save() and delete().
Returns
Type |
Description |
\Zend_Gdata_Appnull |
The current service instance, or null if not set. |



getTitleValue( ) : string
Returns a string representation of the
title of this feed or entry.
The title is an extremely short textual representation of this
resource and is found as an atom:title element in a feed or entry
Returns



lookupNamespace( string $prefix, integer $majorVersion =
null, integer $minorVersion = null ) : string
Get the full version of a namespace
prefix
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.
The current entry or feed's version will be used when performing
the namespace lookup unless overridden using $majorVersion and
$minorVersion. If the entry/fee has a null version, then the latest
protocol version will be used by default.
Parameters
Name |
Type |
Description |
$prefix |
string |
The namespace prefix to lookup. |
$majorVersion |
integer |
The major protocol version in effect. Defaults to null
(auto-select).
|
$minorVersion |
integer |
The minor protocol version in effect. Defaults to null
(auto-select).
|
Returns



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



setAuthor( array $value ) : \Zend_Gdata_App_FeedEntryParent
Sets the list of the authors of this
feed/entry. In an atom feed, each author is represented by an
atom:author element
Parameters
Name |
Type |
Description |
$value |
array |
|
Returns



setCategory( array $value ) : \Zend_Gdata_App_FeedEntryParent
Sets the array of categories that
classify this feed/entry. Each category is represented in an atom feed
by an atom:category element.
Parameters
Name |
Type |
Description |
$value |
array |
Array of Zend_Gdata_App_Extension_Category |
Returns



setContributor( array $value ) : \Zend_Gdata_App_FeedEntryParent
Sets the array of contributors to this
feed/entry. Each contributor is represented in an atom feed by an
atom:contributor XML element
Parameters
Name |
Type |
Description |
$value |
array |
|
Returns



setEtag( string|null $value ) : \Zend_Gdata_App_Entry
Set the Etag for the current entry to
$value. Setting $value to null unsets the Etag.
Parameters
Name |
Type |
Description |
$value |
string|null |
|
Returns



setExtensionAttributes( array $value ) : \Zend_Gdata_App_Base
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
Inherited from: \Zend_Gdata_App_Base::setExtensionAttributes()
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. |



setExtensionElements( array $value ) : \Zend_Gdata_App_Base
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.
Inherited from: \Zend_Gdata_App_Base::setExtensionElements()
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. |



setHttpClient( \Zend_Http_Client $httpClient
) : \Zend_Gdata_App_FeedEntryParent
Set the HTTP client instance
Sets the HTTP client object to use for retrieving the feed.
Parameters
Returns
Details
- deprecated
- Deprecated as of Zend Framework 1.7. Use setService() instead.



setMajorProtocolVersion( \(int|\NULL) $value ) : void
Set the major protocol version that
should be used. Values < 1 (excluding NULL) will cause a
Zend_Gdata_App_InvalidArgumentException to be thrown.
Parameters
Name |
Type |
Description |
$value |
\(int|\NULL) |
The major protocol version to use. |
Throws
Details
- see
- \_majorProtocolVersion



setMinorProtocolVersion( \(int|\NULL) $value ) : void
Set the minor protocol version that
should be used. If set to NULL, no minor protocol version will be sent
to the server. Values < 0 will cause a
Zend_Gdata_App_InvalidArgumentException to be thrown.
Parameters
Name |
Type |
Description |
$value |
\(int|\NULL) |
The minor protocol version to use. |
Throws
Details
- see
- \_minorProtocolVersion



takeChildFromDOM( \DOMNode $child )
: void
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.
Parameters
Name |
Type |
Description |
$child |
\DOMNode |
The DOMNode needed to be handled |



transferFromDOM( \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
|



transferFromXML( string $xml ) : void
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.
Inherited from: \Zend_Gdata_App_Base::transferFromXML()
Parameters
Name |
Type |
Description |
$xml |
string |
The XML text to parse |