comparison vendor/zendframework/zend-feed/src/Reader/Extension/Thread/Entry.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 7a779792577d
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
4 *
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
9
10 namespace Zend\Feed\Reader\Extension\Thread;
11
12 use Zend\Feed\Reader\Extension;
13
14 /**
15 */
16 class Entry extends Extension\AbstractEntry
17 {
18 /**
19 * Get the "in-reply-to" value
20 *
21 * @return string
22 */
23 public function getInReplyTo()
24 {
25 // TODO: to be implemented
26 }
27
28 // TODO: Implement "replies" and "updated" constructs from standard
29
30 /**
31 * Get the total number of threaded responses (i.e comments)
32 *
33 * @return int|null
34 */
35 public function getCommentCount()
36 {
37 return $this->getData('total');
38 }
39
40 /**
41 * Get the entry data specified by name
42 *
43 * @param string $name
44 * @return mixed|null
45 */
46 protected function getData($name)
47 {
48 if (array_key_exists($name, $this->data)) {
49 return $this->data[$name];
50 }
51
52 $data = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/thread10:' . $name . ')');
53
54 if (!$data) {
55 $data = null;
56 }
57
58 $this->data[$name] = $data;
59
60 return $data;
61 }
62
63 /**
64 * Register Atom Thread Extension 1.0 namespace
65 *
66 * @return void
67 */
68 protected function registerNamespaces()
69 {
70 $this->xpath->registerNamespace('thread10', 'http://purl.org/syndication/thread/1.0');
71 }
72 }