Jump to content

Community

Developer Documentation

Review Replies

Invision Community 4.3 introduces a new Reply to a Review feature.
 

To support Review Replies, your Review class needs to define author_response in the column map.

namespace IPS\myapp;

class _MyClass extends \IPS\Content\Review
{
	public static $databaseColumnMap = array(
		/* etc */
		'author_response'	=> 'author_response',
	);
}
	

Additionally, you must add a Mediumtext column to your content items database table with the defined name from the columnMap.

 

New ReviewReply related methods:
 

	/**
	 * Has the author responded to this review?
	 *
	 * @return bool
	 */
	public function hasAuthorResponse()
	
	/**
	 * Can the specified user respond to the review?
	 *
	 * @note	Only the author of the content item can respond by default, but this is abstracted so third parties can override
	 * @param	\IPS\Member|NULL	$member	Member to check or NULL for currently logged in member
	 * @return	bool
	 */
	public function canRespond( $member=NULL )

	/**
	 * Can the specified user edit the response to this review?
	 *
	 * @param	\IPS\Member|NULL	$member	Member to check or NULL for currently logged in member
	 * @return	bool
	 */
	public function canEditResponse( $member=NULL )
	

	/**
	 * Can the specified user delete the response to this review?
	 *
	 * @param	\IPS\Member|NULL	$member	Member to check or NULL for currently logged in member
	 * @return	bool
	 */
	public function canDeleteResponse( $member=NULL )

 

Edited by Daniel F

  Report Document


×
×
  • Create New...

Important Information

We use technologies, such as cookies, to customise content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy