PHP Class Nelmio\Alice\Definition\FlagBag

Inheritance: implements IteratorAggregate, implements Countable
Afficher le fichier Open project: nelmio/alice Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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

count() public méthode

public count ( )

getIterator() public méthode

public getIterator ( )

getKey() public méthode

public getKey ( ) : string
Résultat string

mergeWith() public méthode

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.
Résultat self

withFlag() public méthode

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
Résultat self

withKey() public méthode

public withKey ( string $key ) : self
$key string
Résultat self