[GENERIC] Zend_Translate:
[zend.git] / documentation / manual / en / module_specs / Zend_Feed-ConsumingAtomSingle.xml
blobfdc13584b67a1e33a24412e740ef4a7d0ef30a9f
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- Reviewed: no -->
3 <sect1 id="zend.feed.consuming-atom-single-entry">
4     <title>Consuming a Single Atom Entry</title>
6     <para>
7         Single Atom <command>&lt;entry&gt;</command> elements are also valid by themselves. Usually
8         the <acronym>URL</acronym> for an entry is the feed's <acronym>URL</acronym> followed by
9         <command>/&lt;entryId&gt;</command>, such as
10         <filename>http://atom.example.com/feed/1</filename>, using the example
11         <acronym>URL</acronym> we used above.
12     </para>
14     <para>
15         If you read a single entry, you will still have a <classname>Zend_Feed_Atom</classname>
16         object, but it will automatically create an "anonymous" feed to contain the entry.
17     </para>
19     <example id="zend.feed.consuming-atom-single-entry.example.atom">
20         <title>Reading a Single-Entry Atom Feed</title>
22         <programlisting language="php"><![CDATA[
23 $feed = new Zend_Feed_Atom('http://atom.example.com/feed/1');
24 echo 'The feed has: ' . $feed->count() . ' entry.';
26 $entry = $feed->current();
27 ]]></programlisting>
28     </example>
30     <para>
31         Alternatively, you could instantiate the entry object directly if you know you are accessing
32         an <command>&lt;entry&gt;</command>-only document:
33     </para>
35     <example id="zend.feed.consuming-atom-single-entry.example.entryatom">
36         <title>Using the Entry Object Directly for a Single-Entry Atom Feed</title>
38         <programlisting language="php"><![CDATA[
39 $entry = new Zend_Feed_Entry_Atom('http://atom.example.com/feed/1');
40 echo $entry->title();
41 ]]></programlisting>
42     </example>
43 </sect1>
44 <!--
45 vim:se ts=4 sw=4 et:
46 -->