Skip to content

Instantly share code, notes, and snippets.

@madflow
Created February 6, 2012 21:48
Show Gist options
  • Save madflow/1755133 to your computer and use it in GitHub Desktop.
Save madflow/1755133 to your computer and use it in GitHub Desktop.
Add Argument
<?php
/**
* Add an available argument to the list
* @param $name
* @param string $type
* @param string $description
* @param bool $required
*/
public function addArgument($name, $type = self::ARG_TYPE_MIXED, $description = '', $required = false)
{
$argument = new Custom_TaskArgument();
$argument->setName($name);
$argument->setType($type);
$argument->setDescription($description);
$argument->setRequired($required);
if (true === $required)
$this->addRequiredArgument($name);
$this->arguments[$name] = $argument;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment