Creates a new toolbar item using the passed parameters.

@param array $parameters Passed parameters
@return ButtonToolbarItem
771956
public function create(array $parameters) {
        $toolbarItem = new ButtonToolbarItem($parameters['label'], $parameters['action']);
        unset($parameters['label'], $parameters['action']);
        foreach($parameters as $key => $value) {
            $toolbarItem->$key = $value;
        }
        return $toolbarItem;
    }
457088
public function createBitlyAccessToken(array $parameters)
    {
        /** @var SystemService $systemService */
        $systemService = $this->kernel->getContainer()->get('campaignchain.core.system');
        $systemService->updateBitlyAccessToken($parameters['bitly_access_token']);
    }
668484
public function addParameter($parameter)
    {
        if ($parameter instanceof Zend_Server_Method_Parameter) {
            $this->_parameters[] = $parameter;
            if (null !== ($name = $parameter->getName())) {
                $this->_parameterNameMap[$name] = count($this->_parameters) - 1;
            }
        } else {
            require_once 'Zend/Server/Method/Parameter.php';
            $parameter = new Zend_Server_Method_Parameter(array(
                'type' => (string) $parameter,
            ));
            $this->_parameters[] = $parameter;
        }
        return $this;
    }
876909
public static function createTool($name, $directory, array $parameters)
    {
        $defaults = [
            'url' => null,
            'sign-url' => null,
            'only-dev' => true,
            'force-replace' => false,
            'rename' => false,
        ];

        $parameters = array_merge($defaults, $parameters);

        $tool = new Tool(
            $name,
            self::getFilename($name, $directory),
            $parameters['url'],
            $parameters['sign-url']
        );

        if (true === $parameters['force-replace']) {
            $tool->activateForceReplace();
        }

        if (false === $parameters['only-dev']) {
            $tool->disableOnlyDev();
        }

        if (true === $parameters['rename']) {
            $tool->setNameToToolKey();
        }

        return $tool;
    }
514504
private function addToUrl($parameters)
    {
        /** @var AddToUrlEvent $urlAfter */
        $urlAfter = $this->eventDispatcher->dispatch(ContaoEvents::BACKEND_ADD_TO_URL, new AddToUrlEvent($parameters));

        return $urlAfter->getUrl();
    }
677390
public function setParameters($parameters)
    {
        $this->parameters     = $parameters;
        $this->withParameters = !empty($this->parameters);

        return $this;
    }
950215
public function getParameters(array $parameters = [])
    {
        foreach (['view', 'this'] as $forbiddenKey) {
            if (array_key_exists($forbiddenKey, $parameters)) {
                throw new \ErrorException('The "' . $forbiddenKey . '" key is forbidden.');
            }
        }
        $sharedVariables = $this->getOptionDefault('shared_variables');
        if ($sharedVariables) {
            $parameters = array_merge($sharedVariables, $parameters);
        }
        $parameters['view'] = $this;

        return $parameters;
    }
432115
protected function createParameters($parameters)
    {
        if (is_string($parameters)) {
            $parameters = Parameters::parse($parameters);
        } else {
            $parameters = $parameters ?: array();
        }

        if ($this->defaults) {
            $parameters += $this->defaults;
        }

        return new Parameters($parameters);
    }
934294
protected function createSmtpTransport(array $parameters) {
        $transport = Swift_SmtpTransport::newInstance();
        $host = array_get($parameters, 'host');
        $port = array_get($parameters, 'port');
        $username = array_get($parameters, 'username');
        $password = array_get($parameters, 'password');

        if ($host !== null) {
            $transport->setHost($host);
        }

        if ($port !== null) {
            $transport->setPort($port);
        }

        if ($username !== null) {
            $transport->setUsername($username);
        }

        if ($password !== null) {
            $transport->setPassword($password);
        }

        return $transport;
    }
1003149
public function execute(array $parameters = [], $force = false)
    {
        if ($force === true || $this->checkBuildConditions()) {
            $this->builder->setParameters($parameters);
            $this->build();
        }

        return $this->instance;
    }
1240021
protected function constructActionUrl(array $parameters = array())
    {
        switch($this->uriBuildMethod) {
            case self::PLAIN_URL_BUILD_METHOD;
                return $this->baseUrl;
                break;
            case self::ADDS_ON_URL_BUILD_METHOD;
                return $this->replaceAddsOn($this->baseUrl, $parameters);
                break;
            default;
                throw new Exception\BadConfiguredActionException(
                    sprintf('Unknown url build method: %s', $this->uriBuildMethod),
                    $this
                );
                break;
        }
    }
948408
public function getToolbar($type = 'actionbar')
    {
        $result = null;

        if(isset($this->__toolbars[$type])) {
            $result = $this->__toolbars[$type];
        }

        return $result;
    }
901225
protected function createDeclaration(array $parameters = []): ClassDeclaration
    {
        return $this->container->get(FactoryInterface::class)->make(
            $this->config->declarationClass(static::ELEMENT),
            [
                'name'    => $this->getClass(),
                'comment' => (string)$this->option('comment')
            ] + $parameters + $this->config->declarationOptions(static::ELEMENT)
        );
    }
611869
public function hooks(array $parameters = [])
    {
        $data = $this->client->projects()->hooks($this->id, $parameters);

        $hooks = array();
        foreach ($data as $hook) {
            $hooks[] = ProjectHook::fromArray($this->getClient(), $this, $hook);
        }

        return $hooks;
    }
1229831
public function getToolbar($toolbar, $config = array())
    {
        $identifier = $toolbar;
        if (! ($toolbar instanceof AnServiceIdentifier)) {
            //Create the complete identifier if a partial identifier was passed
           if (is_string($toolbar) && strpos($toolbar, '.') === false) {
               $identifier = clone $this->getIdentifier();
               $identifier->path = array('controller', 'toolbar');
               $identifier->name = $toolbar;
           } else {
               $identifier = $this->getIdentifier($toolbar);
           }
        }

        if (! isset($this->_toolbars[$identifier->name])) {
            $config['controller'] = $this->getMixer();
            $toolbar = $this->getService($identifier, $config);

           //Check the toolbar interface
           if (! ($toolbar instanceof AnControllerToolbarInterface)) {
               throw new AnControllerToolbarException("Controller toolbar $identifier does not implement AnControllerToolbarInterface");
           }
        } else {
            $toolbar = $this->_toolbars[$identifier->name];
        }

        return $toolbar;
    }
687531
public function addToolbarButton($href, $text = '', $params = [])
	{
		if (isset($this->toolbar_buttons[$href])) {
			throw new DataGridException("There is already toolbar button at key [$href] defined.");
		}

		return $this->toolbar_buttons[$href] = new ToolbarButton($this, $href, $text, $params);
	}
731861
public function add(array $parameters)
    {
        foreach ($parameters as $identifier => $value) {
            $this->set($identifier, $value, false);
        }

        return $this;
    }