symfony API

sfCommandOptionSet Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.2 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.2 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 = array())
    Add an array of sfCommandOption objects.
  • array getDefaults()
    Gets an array of default values.
  • getOption($name)
    Returns an option by name.
  • getOptionForShortcut($shortcut)
    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 = array())
    Sets the sfCommandOption objects.
  • string shortcutToName($shortcut)
    Returns the option name given a shortcut.
  • __construct($options = array())
    Constructor.

Method Details

  • addOption ($option) Browse code

    $option A sfCommandOption object

    Add a sfCommandOption objects.

  • addOptions ($options = array()) 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

  • getOption ($name) Browse code

    $name The option name

    Returns an option by name.

    returns A sfCommandOption object

  • getOptionForShortcut ($shortcut) Browse code

    $shortcut

    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 = array()) 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 = array()) Browse code

    $options An array of sfCommandOption objects

    Constructor.