Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\HttpFoundation\Session\Attribute; Chris@0: Chris@0: use Symfony\Component\HttpFoundation\Session\SessionBagInterface; Chris@0: Chris@0: /** Chris@0: * Attributes store. Chris@0: * Chris@0: * @author Drak Chris@0: */ Chris@0: interface AttributeBagInterface extends SessionBagInterface Chris@0: { Chris@0: /** Chris@0: * Checks if an attribute is defined. Chris@0: * Chris@0: * @param string $name The attribute name Chris@0: * Chris@0: * @return bool true if the attribute is defined, false otherwise Chris@0: */ Chris@0: public function has($name); Chris@0: Chris@0: /** Chris@0: * Returns an attribute. Chris@0: * Chris@0: * @param string $name The attribute name Chris@0: * @param mixed $default The default value if not found Chris@0: * Chris@0: * @return mixed Chris@0: */ Chris@0: public function get($name, $default = null); Chris@0: Chris@0: /** Chris@0: * Sets an attribute. Chris@0: * Chris@0: * @param string $name Chris@0: * @param mixed $value Chris@0: */ Chris@0: public function set($name, $value); Chris@0: Chris@0: /** Chris@0: * Returns attributes. Chris@0: * Chris@0: * @return array Attributes Chris@0: */ Chris@0: public function all(); Chris@0: Chris@0: /** Chris@0: * Sets attributes. Chris@0: * Chris@0: * @param array $attributes Attributes Chris@0: */ Chris@0: public function replace(array $attributes); Chris@0: Chris@0: /** Chris@0: * Removes an attribute. Chris@0: * Chris@0: * @param string $name Chris@0: * Chris@0: * @return mixed The removed value or null when it does not exist Chris@0: */ Chris@0: public function remove($name); Chris@0: }