Symfony2 API
Class

Symfony\Component\Console\Helper\HelperSet

class HelperSet

HelperSet represents a set of helpers to be used with a command.

Methods

__construct(array $helpers = array())

Constructor.

set(HelperInterface $helper, string $alias = null)

Sets a helper.

Boolean has(string $name)

Returns true if the helper if defined.

HelperInterface get(string $name)

Gets a helper value.

setCommand(Command $command = null)

Sets the command associated with this helper set.

Command getCommand()

Gets the command associated with this helper set.

Details

at line 31
public __construct(array $helpers = array())

Constructor.

Parameters

array $helpers An array of helper.

at line 45
public set(HelperInterface $helper, string $alias = null)

Sets a helper.

Parameters

HelperInterface $helper The helper instance
string $alias An alias

at line 62
public Boolean has(string $name)

Returns true if the helper if defined.

Parameters

string $name The helper name

Return Value

Boolean true if the helper is defined, false otherwise

at line 76
public HelperInterface get(string $name)

Gets a helper value.

Parameters

string $name The helper name

Return Value

HelperInterface The helper instance

Exceptions

InvalidArgumentException if the helper is not defined

at line 90
public setCommand(Command $command = null)

Sets the command associated with this helper set.

Parameters

Command $command A Command instance

at line 100
public Command getCommand()

Gets the command associated with this helper set.

Return Value

Command A Command instance