98 lines
1.9 KiB
PHP
98 lines
1.9 KiB
PHP
<?php
|
|
|
|
abstract class stProgressBarTask implements stProgressBarTaskInterface
|
|
{
|
|
/**
|
|
*
|
|
* @var sfContext
|
|
*/
|
|
private $context;
|
|
|
|
private $namespace;
|
|
|
|
private $message;
|
|
|
|
final public function __construct(sfContext $context)
|
|
{
|
|
$this->context = $context;
|
|
$this->namespace = get_class($this);
|
|
|
|
$context->getI18N()->setFallbackCatalogue('stAdminGeneratorPlugin');
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return sfContext
|
|
*/
|
|
final public function getContext()
|
|
{
|
|
return $this->context;
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return sfI18N
|
|
*/
|
|
final public function getI18N()
|
|
{
|
|
return $this->context->getI18N();
|
|
}
|
|
|
|
final public function getParameter($name, $default = null)
|
|
{
|
|
$parameters = $this->getParameters();
|
|
|
|
return isset($parameters[$name]) ? $parameters[$name] : $default;
|
|
}
|
|
|
|
final public function setParameter($name, $value)
|
|
{
|
|
$parameters = $this->getParameters();
|
|
|
|
$parameters[$name] = $value;
|
|
|
|
$this->setParameters($parameters);
|
|
}
|
|
|
|
final public function getMessage()
|
|
{
|
|
return $this->message;
|
|
}
|
|
|
|
final public function setMessage($message)
|
|
{
|
|
$this->message = $message;
|
|
}
|
|
|
|
public function getTitle()
|
|
{
|
|
}
|
|
|
|
public function started()
|
|
{
|
|
}
|
|
|
|
public function finished()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* Zwraca wszystkie zapamietane parametry
|
|
*
|
|
* @return array
|
|
*/
|
|
public function getParameters()
|
|
{
|
|
return $this->context->getUser()->getAttribute($this->namespace, array(), 'soteshop/stProgressBarTask');
|
|
}
|
|
|
|
public function clearParameters()
|
|
{
|
|
$this->context->getUser()->getAttributeHolder()->remove($this->namespace, 'soteshop/stProgressBarTask');
|
|
}
|
|
|
|
private function setParameters(array $parameters)
|
|
{
|
|
$this->context->getUser()->setAttribute($this->namespace, $parameters, 'soteshop/stProgressBarTask');
|
|
}
|
|
} |