Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0f6c50a

Browse files
committed
[HttpFoundation] added some method for a better BC
1 parent 146a502 commit 0f6c50a

File tree

1 file changed

+58
-0
lines changed
  • src/Symfony/Component/HttpFoundation/Session

1 file changed

+58
-0
lines changed

src/Symfony/Component/HttpFoundation/Session/Session.php

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,4 +245,62 @@ public function getFlashes()
245245
{
246246
return $this->getBag('flashes');
247247
}
248+
249+
// the following methods are kept for compatibility with Symfony 2.0 (they will be removed for Symfony 2.3)
250+
251+
/**
252+
* @deprecated
253+
*/
254+
public function getFlashes()
255+
{
256+
return $this->getBag('flashes')->all();
257+
}
258+
259+
/**
260+
* @deprecated
261+
*/
262+
public function setFlashes($values)
263+
{
264+
$this->getBag('flashes')->setAll($values);
265+
}
266+
267+
/**
268+
* @deprecated
269+
*/
270+
public function getFlash($name, $default = null)
271+
{
272+
return $this->getBag('flashes')->get($name, $default);
273+
}
274+
275+
/**
276+
* @deprecated
277+
*/
278+
public function setFlash($name, $value)
279+
{
280+
$this->getBag('flashes')->set($name, $value);
281+
}
282+
283+
/**
284+
* @deprecated
285+
*/
286+
public function hasFlash($name)
287+
{
288+
return $this->getBag('flashes')->has($name);
289+
}
290+
291+
/**
292+
* @deprecated
293+
*/
294+
public function removeFlash($name)
295+
{
296+
$this->getBag('flashes')->get($name);
297+
}
298+
299+
/**
300+
* @deprecated
301+
*/
302+
public function clearFlashes()
303+
{
304+
return $this->getBag('flashes')->clear();
305+
}
248306
}

0 commit comments

Comments
 (0)