Files
Phraseanet/lib/Alchemy/Phrasea/Notification/Mail/MailInfoValidationRequest.php
Romain Neutron 0adc141198 Add doc blocks
2013-01-29 11:03:31 +01:00

82 lines
1.6 KiB
PHP

<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2013 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Notification\Mail;
use Alchemy\Phrasea\Exception\LogicException;
class MailInfoValidationRequest extends AbstractMailWithLink
{
/** @var string */
private $title;
/** @var \User_Adapter */
private $user;
/**
* Sets the title of the validation
*
* @param string $title
*/
public function setTitle($title)
{
$this->title = $title;
}
/**
* Sets the user that asks for the validation
*
* @param string $user
*/
public function setUser($user)
{
$this->user = $user;
}
/**
* {@inheritdoc}
*/
public function getSubject()
{
if (!$this->user) {
throw new LogicException('You must set an user before calling getSubject');
}
if (!$this->title) {
throw new LogicException('You must set a title before calling getSubject');
}
return sprintf(_("Validation request from %s : '%s'"), $this->user->get_display_name(), $this->title);
}
/**
* {@inheritdoc}
*/
public function getMessage()
{
return $this->message;
}
/**
* {@inheritdoc}
*/
public function getButtonText()
{
return _('Validate');
}
/**
* {@inheritdoc}
*/
public function getButtonURL()
{
return $this->url;
}
}