public function previous($limit = null) { $limit = is_null($limit) ? $this->_limit : $limit; $data = PersonalizedStream::getTimelineStream($this->_core, $this->_resource, $limit, $this->_cursorTime, null); $cursor = $data->{"meta"}->{"cursor"}; $this->_previous = $cursor->{"hasPrev"}; $this->_next = $cursor->{"prev"} !== null; $this->_cursorTime = $cursor->{"prev"}; return $data; }
public function previous() { $resp = PersonalizedStream::getTimelineStream($this, false); $cursor = $resp->{"meta"}->{"cursor"}; $data = $this->getData(); $data->setPrevious($cursor->{"hasPrev"}); $data->setNext($cursor->{"prev"} !== null); if ($data->isNext()) { $data->setCursorTime($cursor->{"prev"}); } return $resp; }
public function testSubscriptions() { $network = $this->network; $userToken = $network->buildUserAuthToken($this->config->USER_ID, $this->config->USER_ID . "@" . $this->config->NETWORK_NAME, $network::DEFAULT_EXPIRES); $topic1 = PersonalizedStream::createOrUpdateTopic($network, "1", "HANA"); $topic2 = PersonalizedStream::createOrUpdateTopic($network, "2", "DUL"); PersonalizedStream::getSubscriptions($network, $this->config->USER_ID); PersonalizedStream::addSubscriptions($network, $userToken, array($topic1, $topic2)); PersonalizedStream::replaceSubscriptions($network, $userToken, array($topic2)); PersonalizedStream::getSubscribers($network, $topic1); PersonalizedStream::removeSubscriptions($network, $userToken, array($topic2)); PersonalizedStream::deleteTopic($network, $topic1); }