public function Entry::getCommentCount in Zircon Profile 8
Same name in this branch
- 8 vendor/zendframework/zend-feed/src/Writer/Entry.php \Zend\Feed\Writer\Entry::getCommentCount()
- 8 vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Entry.php \Zend\Feed\Reader\Extension\Atom\Entry::getCommentCount()
- 8 vendor/zendframework/zend-feed/src/Reader/Extension/Thread/Entry.php \Zend\Feed\Reader\Extension\Thread\Entry::getCommentCount()
- 8 vendor/zendframework/zend-feed/src/Reader/Extension/Slash/Entry.php \Zend\Feed\Reader\Extension\Slash\Entry::getCommentCount()
Same name and namespace in other branches
- 8.0 vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Entry.php \Zend\Feed\Reader\Extension\Atom\Entry::getCommentCount()
Get the number of comments/replies for current entry
Return value
int
File
- vendor/
zendframework/ zend-feed/ src/ Reader/ Extension/ Atom/ Entry.php, line 405
Class
Namespace
Zend\Feed\Reader\Extension\AtomCode
public function getCommentCount() {
if (array_key_exists('commentcount', $this->data)) {
return $this->data['commentcount'];
}
$count = null;
$this
->getXpath()
->registerNamespace('thread10', 'http://purl.org/syndication/thread/1.0');
$list = $this
->getXpath()
->query($this
->getXpathPrefix() . '//atom:link[@rel="replies"]/@thread10:count');
if ($list->length) {
$count = $list
->item(0)->value;
}
$this->data['commentcount'] = $count;
return $this->data['commentcount'];
}