Services_Akismet
[ class tree: Services_Akismet ] [ index: Services_Akismet ] [ all elements ]

Class: Services_Akismet_Comment

Source Location: /Services_Akismet-0.5.0/Akismet/Comment.php

Class Overview


Akismet comment


Author(s):

Copyright:

  • 2007-2008 Bret Kuhns, 2008 silverorange

Methods


Inherited Variables

Inherited Methods


Class Details

[line 81]
Akismet comment

Example Usage:

  1.  $comment = new Services_Akismet_Comment();
  2.  $comment->setAuthor('Test Author');
  3.  $comment->setAuthorEmail('test@example.com');
  4.  $comment->setAuthorUri('http://example.com/');
  5.  $comment->setContent('Hello, World!');
  6.  
  7.  echo $comment;



[ Top ]


Method Detail

__construct (Constructor)   [line 164]

Services_Akismet_Comment __construct( )

Creates a new comment

The 'user_ip', 'user_agent' and 'referrer' fields are defaulted to the current request values if possible. They may be changed by calling the appropriate setter method.

  • Access: public

[ Top ]

getPostData   [line 222]

string getPostData( )

Gets the fields of this comment as urlencoded HTTP POST data suitable for use in an Akismet API method
  • Return: the fields of this comment as urlencoded HTTP POST data suitable for usage in an Akismet API method.
  • See: comment-check
  • Throws: Services_Akismet_InvalidCommentException if this comment is missing required fields.
  • Access: public

[ Top ]

setAuthor   [line 277]

void setAuthor( string $author)

Sets the author of this comment
  • Access: public

Parameters:

string   $author   —  the author of this comment.

[ Top ]

setAuthorEmail   [line 296]

void setAuthorEmail( string $email)

Sets the email address of the author of this comment
  • Access: public

Parameters:

string   $email   —  the email address of the author of this comment.

[ Top ]

setAuthorUri   [line 315]

void setAuthorUri( string $uri)

Sets the URI of the author of this comment
  • Access: public

Parameters:

string   $uri   —  the URI of the author of this comment.

[ Top ]

setContent   [line 334]

void setContent( string $content)

Sets the content of this comment
  • Access: public

Parameters:

string   $content   —  the content of this comment.

[ Top ]

setHttpReferer   [line 434]

void setHttpReferer( string $http_referer)

Sets the HTTP referer of the user posting this comment

The HTTP referer is automatically set to the HTTP referer from the current page request when this comment is created. Use this method to set the HTTP referer to something different or if the current request does not have a HTTP referer set.

  • Access: public

Parameters:

string   $http_referer   —  the HTTP referer of the user posting this comment.

[ Top ]

setPostPermalink   [line 359]

void setPostPermalink( string $uri)

Sets the permalink of the post to which this comment is being added

A permalink is a URI that points to a specific weblog post and does not change over time. Permalinks are intended to prevent link rot. Akismet does not require the permalink field but can use it to improve spam detection accuracy.

  • Access: public

Parameters:

string   $uri   —  the permalink of the post to which this comment is being added.

[ Top ]

setType   [line 258]

void setType( string $type)

Sets the type of this comment
  • Access: public

Parameters:

string   $type   —  the type of this comment.

[ Top ]

setUserAgent   [line 409]

void setUserAgent( string $user_agent)

Sets the user agent of the user posting this comment

The user agent is automatically set to the user agent from the current page request when this comment is created. Use this method to set the user agent to something different or if the current request does not have a user agent set.

  • Access: public

Parameters:

string   $user_agent   —  the user agent of the user posting this comment.

[ Top ]

setUserIp   [line 384]

void setUserIp( string $ip_address)

Sets the IP address of the user posting this comment

The IP address is automatically set to the IP address from the current page request when this comment is created. Use this method to set the IP address to something different or if the current request does not have an IP address set.

  • Access: public

Parameters:

string   $ip_address   —  the IP address of the user posting this comment.

[ Top ]

__toString   [line 191]

string __toString( )

Gets a string representation of this comment

This is useful for debugging. All the set fields of this comment are returned as well as the results of Services_Akismet_Comment::getPostData().

  • Return: a string representation of this comment.
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:17:03 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.