Class RestNaruto

Description

Implements interfaces:

This class defines the REST client implementation.

Located in /classes/restNaruto.php (line 30)


	
			
Direct descendents
Class Description
RestNarutoBinder This class defines virtual link between client and server implmentations.
Method Summary
RestNaruto RestNaruto (string $url)
string addForumTopic (NarutoCredentials $credentials, string $forumId, string $topic, string $body, [NarutoOptions $options = null])
boolean addTopicPost (NarutoCredentials $credentials, string $forumId, string $topicId, string $subject, string $body, [NarutoOptions $options = null])
array getForumList (NarutoCredentials $credentials, [NarutoOptions $options = null])
array getRecentTopics (NarutoCredentials $credentials, [NarutoOptions $options = null], string $forumId)
NarutoTopic getTopic (NarutoCredentials $credentials, array $forumId, array $topicId, [NarutoOptions $options = null])
array getTopicList (NarutoCredentials $credentials, string $forumId, [NarutoOptions $options = null])
int getUnreadPrivateMessageCount (NarutoCredentials $credentials, [NarutoOptions $options = null])
NarutoUser getUser (NarutoCredentials $credentials, string $userId, [NarutoOptions $options = null])
NarutoUser getUserByName (NarutoCredentials $credentials,  $userName, [NarutoOptions $options = null], string $userId)
NarutoUser getUserBySession (NarutoCredentials $credentials, string $sessionId, [NarutoOptions $options = null])
boolean mergeTopics (NarutoCredentials $credentials, string $forumId, string $topicId, string $intoTopicId, [NarutoOptions $options = null])
array netQuery (string $url, string $path, string $queryString, array $headers, string $data, boolean $postonly)
void setTransactionLog (string $filename)
Methods
Constructor RestNaruto (line 38)

Constructor.

  • access: public
RestNaruto RestNaruto (string $url)
  • string $url: the URL of the RestNarutoService.
addForumTopic (line 172)

Creates a new topic in a Forum.

  • return: id of new topic.
  • exception: NarutoException on error.
  • access: public
string addForumTopic (NarutoCredentials $credentials, string $forumId, string $topic, string $body, [NarutoOptions $options = null])
  • NarutoCredentials $credentials: the callers credentials.
  • string $forumId: The ID of the forum the topic goes in.
  • string $topic: The title of the topic.
  • string $body: the message content for the topic post.
  • NarutoOptions $options: the allowed options if any
    • userName : The name of the user making the post. This should only work if the calling user has admin rights. Default value is the name of the calling user.

Implementation of:
Naruto::addForumTopic()
Creates a new topic in a Forum.
addTopicPost (line 201)

Creates a new post in a topic.

  • return: true
  • exception: NarutoException on error.
  • access: public
boolean addTopicPost (NarutoCredentials $credentials, string $forumId, string $topicId, string $subject, string $body, [NarutoOptions $options = null])
  • NarutoCredentials $credentials: the callers credentials.
  • string $forumId: The ID of the forum where the topics exist
  • string $topicId: The ID of the topic where the topics exist
  • string $subject: the message subject for the topic post.
  • string $body: the message content for the topic post.
  • NarutoOptions $options: the allowed options if any
    • userName : The name of the user making the post. This should only work if the calling user has admin rights. Default value is the name of the calling user.

Implementation of:
Naruto::addTopicPost()
Creates a new post in a topic.
getForumList (line 60)

This method retrieves an a list of forums.

  • return: list of NarutoForum objects. An empty array is returned if there are no forums.
  • exception: NarutoException on error.
  • access: public
array getForumList (NarutoCredentials $credentials, [NarutoOptions $options = null])
  • NarutoCredentials $credentials: the callers credentials.
  • NarutoOptions $options: the allowed options if any
    • string parentId : The id of the parent forum. If not specified then all the forums are returned.
    • string userName : Return list on the authority level of userName. This option should only be authorized for the credentials of administrators.

Implementation of:
Naruto::getForumList()
This method retrieves an a list of forums.
getRecentTopics (line 147)

Returns a list of topics across all forums in order of most recent posts.

  • return: list of NarutoTopic objects. An empty array is returned if there are no topics.
  • exception: NarutoException on error.
  • access: public
array getRecentTopics (NarutoCredentials $credentials, [NarutoOptions $options = null], string $forumId)
  • NarutoCredentials $credentials: the callers credentials.
  • string $forumId: The ID of the forum where the topics exist
  • NarutoOptions $options: the allowed options if any
    • integer limit The maximum number of objects to return.
    • integer maxAge The maximum object age.
    • string userName : Return list on the authority level of userName. This option should only be authorized for the credentials of administrators.

Implementation of:
Naruto::getRecentTopics()
Returns a list of topics across all forums in order of most recent posts.
getTopic (line 114)

Returns information about set of topics.

  • return: a topic. or null.
  • exception: NarutoException on error.
  • access: public
NarutoTopic getTopic (NarutoCredentials $credentials, array $forumId, array $topicId, [NarutoOptions $options = null])
  • NarutoCredentials $credentials: the callers credentials.
  • array $forumId: the forum id.
  • array $topicId: the topic id.
  • NarutoOptions $options: the allowed options if any
    • string userName : Return list on the authority level of userName. This option should only be authorized for the credentials of administrators.

Implementation of:
Naruto::getTopic()
Returns information about set of topics.
getTopicList (line 87)

Returns a list of Topics in a forum.

  • return: list of NarutoTopics objects. An empty array is returned if there are no topics.
  • exception: NarutoException on error.
  • access: public
array getTopicList (NarutoCredentials $credentials, string $forumId, [NarutoOptions $options = null])
  • NarutoCredentials $credentials: the callers credentials.
  • string $forumId: The ID of the forum where the topics exist
  • NarutoOptions $options: the allowed options if any
    • integer limit The maximum number of objects to return.
    • integer offset The starting object index.
    • integer maxAge The maximum object age.
    • string userName : Return list on the authority level of userName. This option should only be authorized for the credentials of administrators.

Implementation of:
Naruto::getTopicList()
Returns a list of Topics in a forum.
getUnreadPrivateMessageCount (line 254)

Gets a count of the number of unread messages.

  • return: number of unread messages.
  • exception: NarutoException on error.
  • access: public
int getUnreadPrivateMessageCount (NarutoCredentials $credentials, [NarutoOptions $options = null])
  • NarutoCredentials $credentials: the callers credentials.
  • NarutoOptions $options: the allowed options if any
    • userName : The name of the user being checked. This should only work if the calling user has admin rights. Default value is the name of the calling user.

Implementation of:
Naruto::getUnreadPrivateMessageCount()
Gets a count of the number of unread messages.
getUser (line 278)

Returns a user's information. Look for user attribute "ban" for indication of banned users.

  • return: a user. or null.
  • exception: NarutoException on error.
  • access: public
NarutoUser getUser (NarutoCredentials $credentials, string $userId, [NarutoOptions $options = null])
  • NarutoCredentials $credentials: the callers credentials.
  • string $userId: the user's id.
  • NarutoOptions $options: the allowed options if any
    • boolean email : true if email should be included in return information. This should only work if the calling user has admin rights.

Implementation of:
Naruto::getUser()
Returns a user's information. Look for user attribute "ban" for indication of banned users.
getUserByName (line 305)

Returns a user's information. Look for user attribute "ban" for indication of banned users.

  • return: a user. or null.
  • exception: NarutoException on error.
  • access: public
NarutoUser getUserByName (NarutoCredentials $credentials,  $userName, [NarutoOptions $options = null], string $userId)
  • NarutoCredentials $credentials: the callers credentials.
  • string $userId: the user's id.
  • NarutoOptions $options: the allowed options if any
    • boolean email : true if email should be included in return information. This should only work if the calling user has admin rights.
  • $userName

Implementation of:
Naruto::getUserByName()
Returns a user's information. Look for user attribute "ban" for indication of banned users.
getUserBySession (line 332)

Returns a user's information. Look for user attribute "ban" for indication of banned users.

  • return: a user. or null. Anonymous users are null.
  • exception: NarutoException on error.
  • access: public
NarutoUser getUserBySession (NarutoCredentials $credentials, string $sessionId, [NarutoOptions $options = null])
  • NarutoCredentials $credentials: the callers credentials.
  • string $sessionId: the user's session id.
  • NarutoOptions $options: the allowed options if any
    • boolean email : true if email should be included in return information. This should only work if the calling user has admin rights.
mergeTopics (line 227)

Merges two topics

  • return: true
  • exception: NarutoException on error.
  • access: public
boolean mergeTopics (NarutoCredentials $credentials, string $forumId, string $topicId, string $intoTopicId, [NarutoOptions $options = null])
  • NarutoCredentials $credentials: the callers credentials.
  • string $forumId: The ID of the forum where the topics exist
  • string $topicId: The ID of the topic being merged
  • string $intoTopicId: the destination topic ID.
  • NarutoOptions $options: the allowed options if any

Implementation of:
Naruto::mergeTopics()
Merges two topics
netQuery (line 423)

netQuery - makes a HTTP request.

  • return: array of [0] => return content and [1] HTTP status code
  • exception: NarutoException on error.
  • access: protected
array netQuery (string $url, string $path, string $queryString, array $headers, string $data, boolean $postonly)
  • string $url: - The service base url less path and query string.
  • string $path: - The path part of the url (PATH_INFO).
  • string $queryString: - The query string.
  • array $headers: - The array of HTTP headers.
  • string $data: - The post data if any.
  • boolean $postonly: - Use POST HTTP method

Redefined in descendants as:
setTransactionLog (line 482)

This method sets the location of the transaction log. By default there is no log, but by setting this logging will be enabled.

  • access: public
void setTransactionLog (string $filename)
  • string $filename: the file to log to.

Documentation generated on Sun, 26 Oct 2008 16:41:21 -0400 by phpDocumentor 1.4.2