cvs: pear /XML_Feed_Parser/Parser Atom.php AtomElement.php
| From: | James Stewart | Date: | Sun, 16 Oct 2005 14:28:27 +0000 |
| Subject: | cvs: pear /XML_Feed_Parser/Parser Atom.php AtomElement.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-35595@lists.php.net to get a copy of this message | ||
jystewart Sun Oct 16 10:28:27 2005 EDT
Modified files:
/pear/XML_Feed_Parser/Parser Atom.php AtomElement.php
Log:
Expanded comments to better explain getText() and getContent()
http://cvs.php.net/diff.php/pear/XML_Feed_Parser/Parser/Atom.php?r1=1.4&r2=1.5&ty=u
Index: pear/XML_Feed_Parser/Parser/Atom.php
diff -u pear/XML_Feed_Parser/Parser/Atom.php:1.4 pear/XML_Feed_Parser/Parser/Atom.php:1.5
--- pear/XML_Feed_Parser/Parser/Atom.php:1.4 Sun Oct 16 10:22:58 2005
+++ pear/XML_Feed_Parser/Parser/Atom.php Sun Oct 16 10:28:27 2005
@@ -17,7 +17,7 @@
* @author James Stewart <james@jystewart.net>
* @copyright 2005 James Stewart <james@jystewart.net>
* @license http://www.gnu.org/copyleft/lesser.html GNU LGPL
2.1
- * @version CVS: $Id: Atom.php,v 1.4 2005/10/16 14:22:58 jystewart Exp $
+ * @version CVS: $Id: Atom.php,v 1.5 2005/10/16 14:28:27 jystewart Exp $
* @link http://dev.jystewart.net/XML_Feed_Parser/
*/
@@ -176,8 +176,10 @@
}
/**
- * Get a text construct. This is probably our most complex basic type as
- * we will want the option to return attributes.
+ * Get a text construct. When calling this method, the two arguments
+ * allowed are 'offset' and 'attribute', so $parser->subtitle() would
+ * return the content of the element, while $parser->subtitle(false, 'type')
+ * would return the value of the type attribute.
*
* @todo Clarify overlap with getContent()
* @param string $method The name of the text construct we want
http://cvs.php.net/diff.php/pear/XML_Feed_Parser/Parser/AtomElement.php?r1=1.4&r2=1.5&ty=u
Index: pear/XML_Feed_Parser/Parser/AtomElement.php
diff -u pear/XML_Feed_Parser/Parser/AtomElement.php:1.4
pear/XML_Feed_Parser/Parser/AtomElement.php:1.5
--- pear/XML_Feed_Parser/Parser/AtomElement.php:1.4 Sun Oct 16 10:22:58 2005
+++ pear/XML_Feed_Parser/Parser/AtomElement.php Sun Oct 16 10:28:27 2005
@@ -17,7 +17,7 @@
* @author James Stewart <james@jystewart.net>
* @copyright 2005 James Stewart <james@jystewart.net>
* @license http://www.gnu.org/copyleft/lesser.html GNU LGPL
2.1
- * @version CVS: $Id: AtomElement.php,v 1.4 2005/10/16 14:22:58 jystewart Exp $
+ * @version CVS: $Id: AtomElement.php,v 1.5 2005/10/16 14:28:27 jystewart Exp $
* @link http://dev.jystewart.net/XML_Feed_Parser/
*/
@@ -130,7 +130,13 @@
* once. It may have a 'src' attribute, in which case there's no content
* If not present, then the entry must have link with rel="alternate".
* If there is content we return it, if not and there's a 'src' attribute
- * we return the value of that instead.
+ * we return the value of that instead. The method can take an 'attribute'
+ * argument, in which case we return the value of that attribute if present.
+ * eg. $item->content("type") will return the type of the content. It is
+ * recommended that all users check the type before getting the content to
+ * ensure that their script is capable of handling the type of returned data.
+ * (data carried in the content element can be either 'text', 'html',
'xhtml',
+ * or any standard MIME type).
*
* @todo Work out overlap with general text construct
* @return string|false