symfony API

sfCommandOptionSet Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.1 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.1 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

Represent a set of command line options.

Method Summary

  • addOption($option)
    Add a sfCommandOption objects.
  • addOptions($options)
    Add an array of sfCommandOption objects.
  • array getDefaults()
    Gets an array of default values.
  • sfCommandOption getOption($name)
    Returns an option by name.
  • sfCommandOption getOptionForShortcut()
    Gets an option by shortcut.
  • array getOptions()
    Gets the array of sfCommandOption objects.
  • Boolean hasOption($name)
    Returns true if an option object exists by name.
  • Boolean hasShortcut($name)
    Returns true if an option object exists by shortcut.
  • setOptions($options)
    Sets the sfCommandOption objects.
  • string shortcutToName($shortcut)
    Returns the option name given a shortcut.
  • __construct($options)
    Constructor.

Method Details

  • addOption ($option) Browse code

    $option A sfCommandOption object

    Add a sfCommandOption objects.

  • addOptions ($options) Browse code

    $options An array of sfCommandOption objects

    Add an array of sfCommandOption objects.

  • (array) getDefaults () Browse code

    Gets an array of default values.

    returns An array of all default values

  • (sfCommandOption) getOption ($name) Browse code

    $name The option name

    Returns an option by name.

    returns A sfCommandOption object

  • (sfCommandOption) getOptionForShortcut () Browse code

    Gets an option by shortcut.

    returns A sfCommandOption object

  • (array) getOptions () Browse code

    Gets the array of sfCommandOption objects.

    returns An array of sfCommandOption objects

  • (Boolean) hasOption ($name) Browse code

    $name The option name

    Returns true if an option object exists by name.

    returns true if the option object exists, false otherwise

  • (Boolean) hasShortcut ($name) Browse code

    $name The option shortcut

    Returns true if an option object exists by shortcut.

    returns true if the option object exists, false otherwise

  • setOptions ($options) Browse code

    $options An array of sfCommandOption objects

    Sets the sfCommandOption objects.

  • (string) shortcutToName ($shortcut) Browse code

    $shortcut The shortcut

    Returns the option name given a shortcut.

    returns The option name

  • __construct ($options) Browse code

    $options An array of sfCommandOption objects

    Constructor.