PHP Class Nelmio\Alice\Definition\FlagBag

Inheritance: implements IteratorAggregate, implements Countable
Mostrar archivo Open project: nelmio/alice Class Usage Examples

Public Methods

Method Description
__construct ( string $key )
count ( )
getIterator ( )
getKey ( ) : string
mergeWith ( self $flags, boolean $override = true ) : self Creates a new instance with the two bags merged together.
withFlag ( Nelmio\Alice\Definition\FlagInterface $flag ) : self Creates a new instance of the bag with the given flag. If a flag with the same identifier already exists, the existing value will be replaced.
withKey ( string $key ) : self

Method Details

__construct() public method

public __construct ( string $key )
$key string String elements from which the flags come from stripped from its flags.

count() public method

public count ( )

getIterator() public method

public getIterator ( )

getKey() public method

public getKey ( ) : string
return string

mergeWith() public method

The original key is kept.
public mergeWith ( self $flags, boolean $override = true ) : self
$flags self
$override boolean If some flags overlaps, the existing one are overridden if the value is true, and left untouched otherwise.
return self

withFlag() public method

Creates a new instance of the bag with the given flag. If a flag with the same identifier already exists, the existing value will be replaced.
public withFlag ( Nelmio\Alice\Definition\FlagInterface $flag ) : self
$flag Nelmio\Alice\Definition\FlagInterface
return self

withKey() public method

public withKey ( string $key ) : self
$key string
return self