deblan.tv/vendor/trinity/src/Trinity/Bundle/UserBundle/Flash/Flash.php

52 lines
932 B
PHP
Raw Normal View History

2015-03-02 21:57:49 +01:00
<?php
namespace Trinity\Bundle\UserBundle\Flash;
abstract class Flash
{
2015-11-25 18:28:10 +01:00
protected $message = null;
2015-03-02 21:57:49 +01:00
2015-11-25 18:28:10 +01:00
protected $options = array();
2015-03-02 21:57:49 +01:00
2015-11-25 18:28:10 +01:00
public function __construct($message, array $options = array())
{
$this->message = $message;
$this->options = $options;
}
2015-03-02 21:57:49 +01:00
2015-11-25 18:28:10 +01:00
public function setOptions(array $options)
{
$this->options = $options;
return $this;
}
public function setOption($name, $value)
{
$this->options[$name] = $value;
return $this;
}
public function getOptions()
{
return $this->options;
}
public function getOption($name, $defaultValue = null)
{
if (array_key_exists($name, $this->options)) {
return $this->options[$name];
}
return null;
}
public function getMessage()
{
return $this->message;
}
abstract public function getTemplate();
2015-03-02 21:57:49 +01:00
}