class Atom in Zircon Profile 8
Same name in this branch
- 8 vendor/zendframework/zend-feed/src/Reader/Entry/Atom.php \Zend\Feed\Reader\Entry\Atom
- 8 vendor/zendframework/zend-feed/src/Reader/Feed/Atom.php \Zend\Feed\Reader\Feed\Atom
- 8 vendor/zendframework/zend-feed/src/Writer/Renderer/Entry/Atom.php \Zend\Feed\Writer\Renderer\Entry\Atom
- 8 vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom.php \Zend\Feed\Writer\Renderer\Feed\Atom
Same name and namespace in other branches
- 8.0 vendor/zendframework/zend-feed/src/Reader/Entry/Atom.php \Zend\Feed\Reader\Entry\Atom
Hierarchy
- class \Zend\Feed\Reader\Entry\AbstractEntry
- class \Zend\Feed\Reader\Entry\Atom implements EntryInterface
Expanded class hierarchy of Atom
3 string references to 'Atom'
- Feed::export in vendor/
zendframework/ zend-feed/ src/ Writer/ Feed.php - Attempt to build and return the feed resulting from the data set
- Reader::registerCoreExtensions in vendor/
zendframework/ zend-feed/ src/ Reader/ Reader.php - Register core (default) extensions
- Writer::registerCoreExtensions in vendor/
zendframework/ zend-feed/ src/ Writer/ Writer.php - Register core (default) extensions
File
- vendor/
zendframework/ zend-feed/ src/ Reader/ Entry/ Atom.php, line 16
Namespace
Zend\Feed\Reader\EntryView source
class Atom extends AbstractEntry implements EntryInterface {
/**
* XPath query
*
* @var string
*/
protected $xpathQuery = '';
/**
* Constructor
*
* @param DOMElement $entry
* @param int $entryKey
* @param string $type
*/
public function __construct(DOMElement $entry, $entryKey, $type = null) {
parent::__construct($entry, $entryKey, $type);
// Everyone by now should know XPath indices start from 1 not 0
$this->xpathQuery = '//atom:entry[' . ($this->entryKey + 1) . ']';
$manager = Reader\Reader::getExtensionManager();
$extensions = [
'Atom\\Entry',
'Thread\\Entry',
'DublinCore\\Entry',
];
foreach ($extensions as $name) {
$extension = $manager
->get($name);
$extension
->setEntryElement($entry);
$extension
->setEntryKey($entryKey);
$extension
->setType($type);
$this->extensions[$name] = $extension;
}
}
/**
* Get the specified author
*
* @param int $index
* @return string|null
*/
public function getAuthor($index = 0) {
$authors = $this
->getAuthors();
if (isset($authors[$index])) {
return $authors[$index];
}
return;
}
/**
* Get an array with feed authors
*
* @return array
*/
public function getAuthors() {
if (array_key_exists('authors', $this->data)) {
return $this->data['authors'];
}
$people = $this
->getExtension('Atom')
->getAuthors();
$this->data['authors'] = $people;
return $this->data['authors'];
}
/**
* Get the entry content
*
* @return string
*/
public function getContent() {
if (array_key_exists('content', $this->data)) {
return $this->data['content'];
}
$content = $this
->getExtension('Atom')
->getContent();
$this->data['content'] = $content;
return $this->data['content'];
}
/**
* Get the entry creation date
*
* @return string
*/
public function getDateCreated() {
if (array_key_exists('datecreated', $this->data)) {
return $this->data['datecreated'];
}
$dateCreated = $this
->getExtension('Atom')
->getDateCreated();
$this->data['datecreated'] = $dateCreated;
return $this->data['datecreated'];
}
/**
* Get the entry modification date
*
* @return string
*/
public function getDateModified() {
if (array_key_exists('datemodified', $this->data)) {
return $this->data['datemodified'];
}
$dateModified = $this
->getExtension('Atom')
->getDateModified();
$this->data['datemodified'] = $dateModified;
return $this->data['datemodified'];
}
/**
* Get the entry description
*
* @return string
*/
public function getDescription() {
if (array_key_exists('description', $this->data)) {
return $this->data['description'];
}
$description = $this
->getExtension('Atom')
->getDescription();
$this->data['description'] = $description;
return $this->data['description'];
}
/**
* Get the entry enclosure
*
* @return string
*/
public function getEnclosure() {
if (array_key_exists('enclosure', $this->data)) {
return $this->data['enclosure'];
}
$enclosure = $this
->getExtension('Atom')
->getEnclosure();
$this->data['enclosure'] = $enclosure;
return $this->data['enclosure'];
}
/**
* Get the entry ID
*
* @return string
*/
public function getId() {
if (array_key_exists('id', $this->data)) {
return $this->data['id'];
}
$id = $this
->getExtension('Atom')
->getId();
$this->data['id'] = $id;
return $this->data['id'];
}
/**
* Get a specific link
*
* @param int $index
* @return string
*/
public function getLink($index = 0) {
if (!array_key_exists('links', $this->data)) {
$this
->getLinks();
}
if (isset($this->data['links'][$index])) {
return $this->data['links'][$index];
}
return;
}
/**
* Get all links
*
* @return array
*/
public function getLinks() {
if (array_key_exists('links', $this->data)) {
return $this->data['links'];
}
$links = $this
->getExtension('Atom')
->getLinks();
$this->data['links'] = $links;
return $this->data['links'];
}
/**
* Get a permalink to the entry
*
* @return string
*/
public function getPermalink() {
return $this
->getLink(0);
}
/**
* Get the entry title
*
* @return string
*/
public function getTitle() {
if (array_key_exists('title', $this->data)) {
return $this->data['title'];
}
$title = $this
->getExtension('Atom')
->getTitle();
$this->data['title'] = $title;
return $this->data['title'];
}
/**
* Get the number of comments/replies for current entry
*
* @return int
*/
public function getCommentCount() {
if (array_key_exists('commentcount', $this->data)) {
return $this->data['commentcount'];
}
$commentcount = $this
->getExtension('Thread')
->getCommentCount();
if (!$commentcount) {
$commentcount = $this
->getExtension('Atom')
->getCommentCount();
}
$this->data['commentcount'] = $commentcount;
return $this->data['commentcount'];
}
/**
* Returns a URI pointing to the HTML page where comments can be made on this entry
*
* @return string
*/
public function getCommentLink() {
if (array_key_exists('commentlink', $this->data)) {
return $this->data['commentlink'];
}
$commentlink = $this
->getExtension('Atom')
->getCommentLink();
$this->data['commentlink'] = $commentlink;
return $this->data['commentlink'];
}
/**
* Returns a URI pointing to a feed of all comments for this entry
*
* @return string
*/
public function getCommentFeedLink() {
if (array_key_exists('commentfeedlink', $this->data)) {
return $this->data['commentfeedlink'];
}
$commentfeedlink = $this
->getExtension('Atom')
->getCommentFeedLink();
$this->data['commentfeedlink'] = $commentfeedlink;
return $this->data['commentfeedlink'];
}
/**
* Get category data as a Reader\Reader_Collection_Category object
*
* @return Reader\Collection\Category
*/
public function getCategories() {
if (array_key_exists('categories', $this->data)) {
return $this->data['categories'];
}
$categoryCollection = $this
->getExtension('Atom')
->getCategories();
if (count($categoryCollection) == 0) {
$categoryCollection = $this
->getExtension('DublinCore')
->getCategories();
}
$this->data['categories'] = $categoryCollection;
return $this->data['categories'];
}
/**
* Get source feed metadata from the entry
*
* @return Reader\Feed\Atom\Source|null
*/
public function getSource() {
if (array_key_exists('source', $this->data)) {
return $this->data['source'];
}
$source = $this
->getExtension('Atom')
->getSource();
$this->data['source'] = $source;
return $this->data['source'];
}
/**
* Set the XPath query (incl. on all Extensions)
*
* @param DOMXPath $xpath
* @return void
*/
public function setXpath(DOMXPath $xpath) {
parent::setXpath($xpath);
foreach ($this->extensions as $extension) {
$extension
->setXpath($this->xpath);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AbstractEntry:: |
protected | property | Feed entry data | |
AbstractEntry:: |
protected | property | DOM document object | |
AbstractEntry:: |
protected | property | Entry instance | |
AbstractEntry:: |
protected | property | Pointer to the current entry | |
AbstractEntry:: |
protected | property | Registered extensions | |
AbstractEntry:: |
protected | property | XPath object | |
AbstractEntry:: |
public | function | Get the DOM | |
AbstractEntry:: |
public | function | Get the entry element | |
AbstractEntry:: |
public | function | Get the Entry's encoding | |
AbstractEntry:: |
public | function | Return an Extension object with the matching name (postfixed with _Entry) | |
AbstractEntry:: |
public | function | Get registered extensions | |
AbstractEntry:: |
public | function | Get the entry type | |
AbstractEntry:: |
public | function | Get the XPath query object | |
AbstractEntry:: |
protected | function | Load extensions from Zend\Feed\Reader\Reader | |
AbstractEntry:: |
public | function | Get entry as xml | |
AbstractEntry:: |
public | function | Method overloading: call given method on first extension implementing it | |
Atom:: |
protected | property | XPath query | |
Atom:: |
public | function |
Get the specified author Overrides EntryInterface:: |
|
Atom:: |
public | function |
Get an array with feed authors Overrides EntryInterface:: |
|
Atom:: |
public | function |
Get category data as a Reader\Reader_Collection_Category object Overrides EntryInterface:: |
|
Atom:: |
public | function |
Get the number of comments/replies for current entry Overrides EntryInterface:: |
|
Atom:: |
public | function |
Returns a URI pointing to a feed of all comments for this entry Overrides EntryInterface:: |
|
Atom:: |
public | function |
Returns a URI pointing to the HTML page where comments can be made on this entry Overrides EntryInterface:: |
|
Atom:: |
public | function |
Get the entry content Overrides EntryInterface:: |
|
Atom:: |
public | function |
Get the entry creation date Overrides EntryInterface:: |
|
Atom:: |
public | function |
Get the entry modification date Overrides EntryInterface:: |
|
Atom:: |
public | function |
Get the entry description Overrides EntryInterface:: |
|
Atom:: |
public | function |
Get the entry enclosure Overrides EntryInterface:: |
|
Atom:: |
public | function |
Get the entry ID Overrides EntryInterface:: |
|
Atom:: |
public | function |
Get a specific link Overrides EntryInterface:: |
|
Atom:: |
public | function |
Get all links Overrides EntryInterface:: |
|
Atom:: |
public | function |
Get a permalink to the entry Overrides EntryInterface:: |
|
Atom:: |
public | function | Get source feed metadata from the entry | |
Atom:: |
public | function |
Get the entry title Overrides EntryInterface:: |
|
Atom:: |
public | function |
Set the XPath query (incl. on all Extensions) Overrides AbstractEntry:: |
|
Atom:: |
public | function |
Constructor Overrides AbstractEntry:: |