Permalink
Browse files

[HttpFoundation] added some method for a better BC

  • Loading branch information...
1 parent 146a502 commit 0f6c50ac69c54df0b17f1fb3080ca2fa86009a7b @fabpot fabpot committed Feb 11, 2012
Showing with 58 additions and 0 deletions.
  1. +58 −0 src/Symfony/Component/HttpFoundation/Session/Session.php
@@ -245,4 +245,62 @@ public function getFlashes()
{
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();
+ }
}

0 comments on commit 0f6c50a

Please sign in to comment.