[HttpFoundation] added some method for a better BC

This commit is contained in:
Fabien Potencier 2012-02-11 12:43:38 +01:00
parent 146a502a0e
commit 0f6c50ac69
1 changed files with 58 additions and 0 deletions

View File

@ -245,4 +245,62 @@ class Session implements SessionInterface
{
return $this->getBag('flashes');
}
// the following methods are kept for compatibility with Symfony 2.0 (they will be removed for Symfony 2.3)
/**
* @deprecated
*/
public function getFlashes()
{
return $this->getBag('flashes')->all();
}
/**
* @deprecated
*/
public function setFlashes($values)
{
$this->getBag('flashes')->setAll($values);
}
/**
* @deprecated
*/
public function getFlash($name, $default = null)
{
return $this->getBag('flashes')->get($name, $default);
}
/**
* @deprecated
*/
public function setFlash($name, $value)
{
$this->getBag('flashes')->set($name, $value);
}
/**
* @deprecated
*/
public function hasFlash($name)
{
return $this->getBag('flashes')->has($name);
}
/**
* @deprecated
*/
public function removeFlash($name)
{
$this->getBag('flashes')->get($name);
}
/**
* @deprecated
*/
public function clearFlashes()
{
return $this->getBag('flashes')->clear();
}
}