Files
Phraseanet/lib/Alchemy/Phrasea/TaskManager/Log/TaskLogFile.php
Jean-Yves Gaulier 78be8977de wip
2015-12-23 11:14:55 +01:00

53 lines
1014 B
PHP

<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2014 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\TaskManager\Log;
use Alchemy\Phrasea\Model\Entities\Task;
class TaskLogFile extends AbstractLogFile implements LogFileInterface
{
/** @var Task */
private $task;
public function __construct($root, Task $task)
{
parent::__construct($root);
$this->task = $task;
}
/**
* {@inheritdoc}
*/
public function getVersions()
{
return array('', '2015-12-21');
}
/**
* Returns the related Task entity.
*
* @return Task
*/
public function getTask()
{
return $this->task;
}
/**
* {@inheritdoc}
*/
public function getPath($version)
{
return sprintf('%s/task_%d%s.log', $this->root, $this->task->getId(), $version ? ('-'.$version) : '');
}
}