1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-13 04:04:12 +02:00

[ticket/10073] Add doc blocks to new classes

PHPBB3-10073
This commit is contained in:
Joas Schilling
2014-04-13 23:24:10 +02:00
parent 5c13829111
commit 67cf0a912c
5 changed files with 251 additions and 23 deletions

View File

@@ -9,15 +9,31 @@
namespace phpbb\message;
/**
* Class topic_form
* Form used to send topics as notification emails
*
* @package phpbb\message
*/
class topic_form extends form
{
/** @var int */
protected $topic_id;
/** @var array */
protected $topic_row;
/** @var string */
protected $recipient_address;
/** @var string */
protected $recipient_name;
/** @var string */
protected $recipient_lang;
/**
* Get the data of the topic
*
* @param int $topic_id
* @return false|array false if the topic does not exist, array otherwise
*/
protected function get_topic_row($topic_id)
{
$sql = 'SELECT forum_id, topic_title
@@ -30,6 +46,9 @@ class topic_form extends form
return $row;
}
/**
* {inheritDoc}
*/
public function check_allow()
{
$error = parent::check_allow();
@@ -61,6 +80,9 @@ class topic_form extends form
return false;
}
/**
* {inheritDoc}
*/
public function bind(\phpbb\request\request_interface $request)
{
parent::bind($request);
@@ -73,6 +95,9 @@ class topic_form extends form
$this->topic_row = $this->get_topic_row($this->topic_id);
}
/**
* {inheritDoc}
*/
public function submit(\messenger $messenger)
{
if (!$this->recipient_address || !preg_match('/^' . get_preg_expression('email') . '$/i', $this->recipient_address))
@@ -102,11 +127,17 @@ class topic_form extends form
parent::submit($messenger);
}
/**
* {inheritDoc}
*/
public function get_return_message()
{
return sprintf($this->user->lang['RETURN_TOPIC'], '<a href="' . append_sid($this->phpbb_root_path . 'viewtopic.' . $this->phpEx, 'f=' . $this->topic_row['forum_id'] . '&amp;t=' . $this->topic_id) . '">', '</a>');
}
/**
* {inheritDoc}
*/
public function render(\phpbb\template\template $template)
{
parent::render($template);