interface AttributeBagInterface implements SessionBagInterface
Attributes store.
public
|
string |
getName()
|
Gets this bag's name. | from SessionBagInterface |
public
|
|
initialize(array $array)
|
Initializes the Bag. | from SessionBagInterface |
public
|
string |
getStorageKey()
|
Gets the storage key for this bag. | from SessionBagInterface |
public
|
mixed |
clear()
|
Clears out data from bag. | from SessionBagInterface |
public
|
bool |
has(string $name)
|
Checks if an attribute is defined. | |
public
|
mixed |
get(string $name, mixed $default = null)
|
Returns an attribute. | |
public
|
|
set(string $name, mixed $value)
|
Sets an attribute. | |
public
|
array |
all()
|
Returns attributes. | |
public
|
|
replace(array $attributes)
|
Sets attributes. | |
public
|
mixed |
remove(string $name)
|
Removes an attribute. |
getName()public string getName()
Gets this bag's name.
string |
initialize()public initialize(array $array)
Initializes the Bag.
array |
$array |
getStorageKey()public string getStorageKey()
Gets the storage key for this bag.
string |
clear()public mixed clear()
Clears out data from bag.
mixed |
Whatever data was contained |
has()public bool has(string $name)
Checks if an attribute is defined.
string |
$name |
The attribute name |
bool |
true if the attribute is defined, false otherwise |
get()public mixed get(string $name, mixed $default = null)
Returns an attribute.
string |
$name |
The attribute name |
mixed |
$default |
The default value if not found |
mixed |
set()public set(string $name, mixed $value)
Sets an attribute.
string |
$name |
|
mixed |
$value |
all()public array all()
Returns attributes.
array |
Attributes |
replace()public replace(array $attributes)
Sets attributes.
array |
$attributes |
Attributes |
remove()public mixed remove(string $name)
Removes an attribute.
string |
$name |
mixed |
The removed value or null when it does not exist |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpFoundation\Session\Attribute;
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
/**
* Attributes store.
*
* @author Drak <drak@zikula.org>
*/
interface AttributeBagInterface extends SessionBagInterface
{
/**
* Checks if an attribute is defined.
*
* @param string $name The attribute name
*
* @return bool true if the attribute is defined, false otherwise
*/
public function has($name);
/**
* Returns an attribute.
*
* @param string $name The attribute name
* @param mixed $default The default value if not found
*
* @return mixed
*/
public function get($name, $default = null);
/**
* Sets an attribute.
*
* @param string $name
* @param mixed $value
*/
public function set($name, $value);
/**
* Returns attributes.
*
* @return array Attributes
*/
public function all();
/**
* Sets attributes.
*
* @param array $attributes Attributes
*/
public function replace(array $attributes);
/**
* Removes an attribute.
*
* @param string $name
*
* @return mixed The removed value or null when it does not exist
*/
public function remove($name);
}