Create a new command.

@param string $name Name of the command
@param string $description Command description
@param string $code Unique code for this command
@return XiboCommand
548382
public function create($name, $description, $code)
	{
		$this->userId = $this->getEntityProvider()->getMe()->getId();
		$this->command = $name;
		$this->description = $description;
		$this->code = $code;
		$this->getLogger()->info('Creating new display command ' . $name);
		$response = $this->doPost('/command', $this->toArray());

		return $this->hydrate($response);
	}
517598
public function addCommand($name, $config = array())
    {
        if (!isset($config['label']) && in_array($name, self::$_default_buttons)) {
            $config['label'] = 'JTOOLBAR_'.$name;
        }

        return parent::addCommand($name, $config);
    }
525584
public function createRole($name, $key = null, $description = null)
    {
        $key        =   snake_case(isset($key) ? $key : $name);
        $description=   isset($description) ? $description : $name;
        $values     =   compact('name', 'key', 'description');

        return $this->roleProvider->create($values);
    }
1204093
public function option($name, $shortcut = null, $mode = null, $description = '', $default = null)
    {
        $option = new InputOption($name, $shortcut, $mode, $description, $default);
        $this->addOption($option);

        return $this;
    }
1233863
public function getCommand($name, $config = array())
    {
        if (! isset($this->_commands[$name])) {
            //Create the config object
            $command = new AnControllerToolbarCommand($name, $config);

            //Find the command function to call
            if (method_exists($this, '_command'.ucfirst($name))) {
                $function =  '_command'.ucfirst($name);
                $this->$function($command);
            } else {
                //Don't set an action for GET commands
                if(! isset($command->attribs->href)) {
                    $command->append(array(
         				'attribs'    => array(
               				'data-action'  => $command->getName()
                        )
                    ));
                }
            }
        }
        else $command = $this->_commands[$name];

        return $command;
    }
1101832
public static function on($command,callable $callback,$description=''){
      $parts = preg_split('/\s+/',$command);
      static::$commands[array_shift($parts)] = [$parts,$callback,$description];
    }
1079469
public function argumentModeRequired($name, $description, $defaultValue = null)
    {
        $mode = InputArgument::REQUIRED;
        return [$name, $mode, $description, $defaultValue];
    }
1102236
public function createSafe($name, $description)
    {
        $parameters = array(
          'name' => $name,
          'description' => $description,
        );

        return $this->online->call('/storage/c14/safe', 'POST', $parameters);
    }
982325
public function getCommand($name, $config = array())
    {
        if(!isset($this->__commands[$name]))
        {
            //Create the config object
            $command = new ControllerToolbarCommand($name, $config);

            //Attach the command to the toolbar
            $command->setToolbar($this);

            //Find the command function to call
            if (method_exists($this, '_command' . ucfirst($name)))
            {
                $function = '_command' . ucfirst($name);
                $this->$function($command);
            }
            else
            {
                //Don't set an action for GET commands
                if (!isset($command->href))
                {
                    $command->append(array(
                        'data' => array(
                            'action' => $command->getName()
                        )
                    ));
                }
            }
        }
        else $command = $this->__commands[$name];

        return $command;
    }
632321
protected function addCommand($name, array $parameters = array())
    {
        $this->commands[] = $command = $this->createCommand($name, $parameters);

        return $command;
    }
721944
public function add($name, $class, $description = null) {

        if ( array_key_exists($name, $this->data) ) {
            $this->logger->warning("Skipping duplicate task $name ($class)");
            return false;
        }

        if ( empty($name) || empty($class) || !class_exists($class) ) {
            $this->logger->warning("Skipping invalid task definition", array(
                "NAME"       => $name,
                "CLASS"      => $class,
                "DESCRIPTION"=> $description
            ));
            return false;
        }

        $this->data[$name] = new TaskItem(
            $this->getConfiguration(),
            $this->getEvents(),
            $this->getLogger(),
            $name,
            $class,
            $description
        );

        $this->logger->debug("Task $name ($class) in table");

        return true;

    }
947042
public static function build($name, $version, $description)
    {
        $api = new static();
        $api->name = $name;
        $api->apiVersion = $version;
        $api->description = $description;

        return $api;
    }
1171275
public function redirectAction(Request $request, $name, $code = 301)
    {
        return new RedirectResponse(
            $this->get('zicht_url.provider')->url($name),
            $code
        );
    }
1197917
public function create($code, $name)
    {
        $transformer = new CreateTransformer($code, $name);
        $body        = $transformer->output();

        /** @var \SkyHub\Api\Handler\Response\HandlerInterface $responseHandler */
        $responseHandler = $this->service()->post($this->baseUrlPath(), $body);

        return $responseHandler;
    }
1337731
public function add($name, $code, $title)
	{
		$templates = $this->getTemplates();
		$templates->add($name, $this->plugin->name, $code, $title);
	}
308339
private function createProductOption($name, $code = null, $position = null)
    {
        /** @var ProductOptionInterface $productOption */
        $productOption = $this->productOptionFactory->createNew();
        $productOption->setName($name);
        $productOption->setCode($code ?: StringInflector::nameToCode($name));
        $productOption->setPosition((null === $position) ? null : (int) $position);

        $this->sharedStorage->set('product_option', $productOption);
        $this->productOptionRepository->add($productOption);

        return $productOption;
    }
809708
public function arg($name, $description, $required = false) {
        $this->currentSchema[Cli::META][Cli::ARGS][$name] =
            ['description' => $description, 'required' => $required];
        return $this;
    }