PHP Класс Nelmio\Alice\Definition\FlagBag

Наследование: implements IteratorAggregate, implements Countable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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

Описание методов

__construct() публичный Метод

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

count() публичный Метод

public count ( )

getIterator() публичный Метод

public getIterator ( )

getKey() публичный Метод

public getKey ( ) : string
Результат string

mergeWith() публичный Метод

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.
Результат self

withFlag() публичный Метод

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
Результат self

withKey() публичный Метод

public withKey ( string $key ) : self
$key string
Результат self