symfony API

sfCommandOption Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.4 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.4 version. Switch to:

Represents a command line option.

Method Summary

  • Boolean acceptParameter()
    Returns true if the option accept a parameter.
  • mixed getDefault()
    Returns the default value.
  • string getHelp()
    Returns the help text.
  • string getName()
    Returns the name.
  • string getShortcut()
    Returns the shortcut.
  • Boolean isArray()
    Returns true if the option can take multiple values.
  • Boolean isParameterOptional()
    Returns true if the option takes an optional parameter.
  • Boolean isParameterRequired()
    Returns true if the option requires a parameter.
  • setDefault($default)
    Sets the default value.
  • __construct($name, $shortcut, $mode, $help, $default)
    Constructor.

Method Details

  • (Boolean) acceptParameter () Browse code

    Returns true if the option accept a parameter.

    returns true if parameter mode is not self::PARAMETER_NONE, false otherwise

  • (mixed) getDefault () Browse code

    Returns the default value.

    returns The default value

  • (string) getHelp () Browse code

    Returns the help text.

    returns The help text

  • (string) getName () Browse code

    Returns the name.

    returns The name

  • (string) getShortcut () Browse code

    Returns the shortcut.

    returns The shortcut

  • (Boolean) isArray () Browse code

    Returns true if the option can take multiple values.

    returns true if mode is self::IS_ARRAY, false otherwise

  • (Boolean) isParameterOptional () Browse code

    Returns true if the option takes an optional parameter.

    returns true if parameter mode is self::PARAMETER_OPTIONAL, false otherwise

  • (Boolean) isParameterRequired () Browse code

    Returns true if the option requires a parameter.

    returns true if parameter mode is self::PARAMETER_REQUIRED, false otherwise

  • setDefault ($default) Browse code

    $default The default value

    Sets the default value.

  • __construct ($name, $shortcut, $mode, $help, $default) Browse code

    $name The option name
    $shortcut The shortcut (can be null)
    $mode The option mode: self::PARAMETER_REQUIRED, self::PARAMETER_NONE or self::PARAMETER_OPTIONAL
    $help A help text
    $default The default value (must be null for self::PARAMETER_REQUIRED or self::PARAMETER_NONE)

    Constructor.