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

Class: Services_Akismet_Comment

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

Class Overview


Akismet comment


Author(s):

Copyright:

  • 2007-2008 Bret Kuhns, 2008 silverorange

Methods


Inherited Variables

Inherited Methods


Class Details

[line 82]
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 165]

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 223]

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 278]

void setAuthor( string $author)

Sets the author of this comment
  • Access: public

Parameters:

string   $author   —  the author of this comment.

[ Top ]

setAuthorEmail   [line 297]

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 316]

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 335]

void setContent( string $content)

Sets the content of this comment
  • Access: public

Parameters:

string   $content   —  the content of this comment.

[ Top ]

setHttpReferer   [line 435]

void setHttpReferer( string $httpReferer)

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   $httpReferer   —  the HTTP referer of the user posting this comment.

[ Top ]

setPostPermalink   [line 360]

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 259]

void setType( string $type)

Sets the type of this comment
  • Access: public

Parameters:

string   $type   —  the type of this comment.

[ Top ]

setUserAgent   [line 410]

void setUserAgent( string $userAgent)

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   $userAgent   —  the user agent of the user posting this comment.

[ Top ]

setUserIp   [line 385]

void setUserIp( string $ipAddress)

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   $ipAddress   —  the IP address of the user posting this comment.

[ Top ]

__toString   [line 192]

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:21:08 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.