(non-PHPdoc)

@see \Core\Html\Form\Input::build()

@throws UnexpectedValueException
517975
public function build()
    {
        // Prepare options object
        $options = new \stdClass();

        // Set options which are set active
        foreach ($this->set_options as $option) {

            switch ($option) {

                // Check date
                case 'option_disabled_days':
                case 'option_enabled_dates':

                    $options->{$option} = [];

                    foreach ($this->{$option} as $date) {

                        if (!is_int($date) || !$date instanceof \DateTime || !is_string($date)) {
                            Throw new ControlException('Datepicker controls ' . $option . ' date must by of type integer (timestamp), string or DateTime object.', 1000);
                        }

                        if (is_string($date)) {
                            $date = strtotime($date);
                        }

                        if ($date instanceof \DateTime) {
                            $date = $date->getTimestamp();
                        }

                        $options->{$option}[] = date('Y-m-d', $date);
                    }

                    break;

                default:

                    $options->{$option} = $this->{'option_' . $option};
                    break;
            }
        }

        $options->format = $this->format;

        // Add options as json encoded data attribute
        $this->data['datepicker-options'] = json_encode($options);

        return parent::build();
    }
648519
public function build()
    {

        $query_params = [];

        $query_params["query"] = $this->q;

        if($this->boost > 1) {
            $query_params["boost"] = $this->boost;
        }

        if(count($this->fields)){
            $query_params["fields"] = $this->fields;
        }

        $this->query->must[] = [
            "query_string" => $query_params
        ];
    }
297487
public function build(): SetCookieRequest
	{
		$instance = new SetCookieRequest();
		if ($this->name === null) {
			throw new BuilderException('Property [name] is required.');
		}
		$instance->name = $this->name;
		if ($this->value === null) {
			throw new BuilderException('Property [value] is required.');
		}
		$instance->value = $this->value;
		$instance->url = $this->url;
		$instance->domain = $this->domain;
		$instance->path = $this->path;
		$instance->secure = $this->secure;
		$instance->httpOnly = $this->httpOnly;
		$instance->sameSite = $this->sameSite;
		$instance->expires = $this->expires;
		return $instance;
	}
422491
public function set($fields = null)
    {
        if ($fields === null) {
            return $this->clause('set');
        }

        if (!in_array($this->action(), [self::ACTION_CREATE, self::ACTION_UPDATE])) {
            throw new \UnexpectedValueException(__('The action of this query needs to be either create update'));
        }

        $this->_parts['set'] = $fields;

        return $this;
    }
833913
public function build()
    {
        if (empty($this->form)) {
            Throw new ControlException('Editbox control needs a set FormDesigner or Form object.');
        }

        // Editbox CSS class needed
        $this->panel->html->addCss('editbox');

        // Create panel heading with title
        $heading = $this->panel->createHeading();

        $title = $heading->createTitle();
        $title->setTitle($this->caption);

        if (! empty($this->description)) {
            $title->setDescription($this->description, true);
        }

        $heading->addContent($title);

        // Create panel body

        if ($this->form instanceof FormDesigner) {
            $form_id = $this->form->html->getId();
            $form_action = $this->form->html->getAttribute('action');

            // Ajax form?
            $this->is_ajax = $this->form->getSendMode() == 'ajax' ? true : false;
        }
        else {
            $form_id = $this->form->getId();
            $form_action = $this->form->getAttribute('action');
        }

        // Build form here because it's possible that form id will be autogenerated
        // and we need this id in the next step.
        $body = $this->panel->createBody();
        $body->addContent($this->form);

        // Footer with toolbar

        /* @var $toolbar \Core\Html\Bootstrap\Buttongroups\ButtonToolbar */
        $toolbar = $this->factory->create('Bootstrap\Buttongroups\ButtonToolbar');

        $create_action = function (Action $action, $with_link = false) {

            $text = $action->getText();
            $icon = $action->getIcon();

            if (! empty($icon)) {
                $text = $icon->build() . ' ' . $text;
            }

            if ($with_link) {

                $href = $action->getHref();

                if (! empty($href)) {

                    /* @var $a \Core\Html\Elements\A */
                    $a = $this->factory->create('Elements\A');

                    $a->setHref($href);

                    if ($action->getAjax()) {
                        $a->addData('ajax');
                    }

                    if ($action->getConfirm()) {
                        $a->addData('confirm', $action->getConfirm());
                    }

                    $a->setInner($text);

                    $text = $a->build();
                }
            }
            return $text;
        };

        // Make sure that he buttons have the correct order
        ksort($this->actions);

        foreach ($this->actions as $type => $action) {

            switch ($type) {
                case 0:
                case 1:

                    /* @var $group \Core\Html\Bootstrap\Buttongroups\ButtonGroup */
                    $group = $toolbar->createButtongroup();
                    $group->addCss('btn-group-sm');

                    switch ($type) {
                        case 0:

                            $button = $group->createButton();
                            $button->setFormId($form_id);
                            $button->setFormAction($form_action);
                            $button->isSuccess();

                            if ($this->is_ajax) {
                                $button->addData('ajax');
                            }
                            else {
                                $button->setType('submit');
                            }

                            break;

                        case 1:
                            $group->addCss('pull-right');

                            /* @var $button \Core\Html\Controls\UiButton */
                            $button = $group->createButton('Controls\UiButton');
                            $button->setHref($action->getHref());
                            $button->addCss('btn-danger');

                            if ($this->is_ajax) {
                                $button->addData('ajax');
                            }
                            break;
                    }

                    $button->setInner($create_action($this->actions[$type]));

                    break;

                case 2:
                default:

                    /* @var $group \Core\Html\Bootstrap\Buttongroups\ButtonGroup */
                    $group = $toolbar->createButtongroup();
                    $group->addCss('btn-group-sm pull-right dropup');

                    /* @var $context_menu \Core\Html\Form\Button */
                    $context_menu = $this->factory->create('Bootstrap\Button\Button');
                    $context_menu->addCss('dropdown-toggle');
                    $context_menu->addAria([
                        'haspopup' => "true",
                        'expanded' => "false"
                    ]);
                    $context_menu->addData('toggle', 'dropdown');

                    // Do we have a text to show on actions button?
                    if (! empty($this->context_text)) {
                        $context_menu->addInner($this->context_text . ' ');
                    }

                    $context_menu->addInner('<span class="caret"></span>');

                    $group->setInner($context_menu->build());

                    // Create the actions dropdown menu
                    $dropdown = '<ul class="dropdown-menu">';

                    foreach ($this->actions[$type] as $action) {
                        $dropdown .= '<li>' . $create_action($action, true) . '</li>';
                    }

                    $dropdown .= '</ul>';

                    $group->addInner($dropdown);

                    break;
            }
        }

        $footer = $this->panel->createFooter();
        $footer->addContent($toolbar);

        return $this->panel->build();
    }
592520
protected function build()
    {
        foreach ($this->keys as $tag => $code) {
            $this->tags["<{$tag}>"]    = $code;
            $this->tags["</{$tag}>"]   = $code;
            $this->tags["<\\/{$tag}>"] = $code;
        }
    }
114650
public function build()
    {
        $layout = Layout::blank([
            $this->layout(),
        ]);

        return $layout->build($this->post);
    }
21369
public function form_input($params) {
        if (!isset($params['field'])) {
            throw new \UnexpectedValueException("The field parameter is required.");
        }
        $value = isset($params['value']) ? $params['value'] : null;
        $attributes = isset($params['attrs']) ? $params['attrs'] : array();
        return Form::input($params['field'], $value, $attributes);
    }
20479
public function build()
    {
        parent::build();

        $options = $this->suppliedOptions;

        $dataOptions        = $options['options'];
        $options['options'] = array();

        //iterate over the options to create the options assoc array
        foreach ($dataOptions as $val => $text) {
            $options['options'][] = array(
                'id'   => is_numeric($val) ? $text : $val,
                'text' => $text,
            );
        }

        $this->suppliedOptions = $options;
    }
1318979
public function build()
    {
        $issue = $this->root;
        $this->issues[$issue->getKey()] = $issue;

        $unreceivedIssues = array_diff_key($this->issues, $this->populatedIssueKeys);
        while (count($unreceivedIssues) > 0 && $this->depth < $this->maxDepth) {
            $unpopulatedIssueKeys = [];
            foreach ($unreceivedIssues as $issue) {
                /** @var Issue $issue */
                $this->populatedIssueKeys[$issue->getKey()] = 1;

                foreach ($issue->getLinks() as $issueLink) {
                    $unpopulatedIssueKey = IssueLinkHelper::getLinkedIssueKey($issueLink);
                    if ($unpopulatedIssueKey) {
                        $unpopulatedIssueKeys[$unpopulatedIssueKey] = $unpopulatedIssueKey;
                    }
                }
            }

            $notProcessedIssueKeys = [];
            foreach ($unpopulatedIssueKeys as $issueKey) {
                if (!array_key_exists($issueKey, $this->issues)) {
                    $notProcessedIssueKeys[] = $issueKey;
                }
            }

            if ($notProcessedIssueKeys) {
                $issues = $this->getIssuesFromRepositoryByKeys($notProcessedIssueKeys);
                foreach ($issues as $issue) {
                    if (!array_key_exists($issue->getKey(), $this->issues)) {
                        $this->issues[$issue->getKey()] = $issue;
                    }
                }
            }

            $unreceivedIssues = array_diff_key($this->issues, $this->populatedIssueKeys);
            $this->depth++;
        }
    }
793993
public function asSet(): Constructed\Set
    {
        if (!$this->_element instanceof Constructed\Set) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_SET));
        }
        return $this->_element;
    }
1043983
public function build(): HandleJavaScriptDialogRequest
	{
		$instance = new HandleJavaScriptDialogRequest();
		if ($this->accept === null) {
			throw new BuilderException('Property [accept] is required.');
		}
		$instance->accept = $this->accept;
		$instance->promptText = $this->promptText;
		return $instance;
	}
921968
protected function setLoaded()
    {
        $this->loadedPkv = $this->getPkv();
        if($this->loadedPkv === null) {
            throw new \UnexpectedValueException('The data is not loaded.');
        }
        return $this;
    }
1150422
public function build()
    {
        $values = array( 'access'           => false,
                         'genres'           => false,
                         'publication_date' => false,
                         'title'            => true,
                         'keywords'         => true,
                         'stock_tickers'    => true
        );
        foreach ($values as $value => $isEscaped) {
            if ( ! is_null( $this->{$value} )) {
                $this->addChild( sprintf( 'news:%s', $value ), $this->{$value}, $isEscaped );
            }
        }
    }
451302
public function build()
    {
        $client         = $this->buildClient();
        $requestHandler = $this->getRequestHandler();
        // Pass through any configuration options set here which need to be made
        // available elsewhere in the ThisData instance.
        $configuration  = [
            self::CONF_EXPECT_JS_COOKIE => $this->expectJsCookie
        ];

        return new ThisData($client, $requestHandler, $configuration);
    }
1281141
public function build()
    {
        $options = $this->suppliedOptions;

        //build the string or callable values for title and confirmation
        $this->buildStringOrCallable($options, array('confirmation', 'title'));

        //build the string or callable values for the messages
        $messages = $this->validator->arrayGet($options, 'messages', array());
        $this->buildStringOrCallable($messages, array('active', 'success', 'error'));
        $options['messages'] = $messages;

        //override the supplied options
        $this->suppliedOptions = $options;
    }
1264249
private function build() {

        //Get value
        $selected = null;

        if(true === $this -> filled) {

            if(true === isset($this -> attributes['name'])) {

                if(true === Request :: isPost()) {
                    $selected = Request :: fromPost($this -> attributes['name']);
                }
            }
        }

        //Build select
        $html = '<select';
        
        foreach($this -> attributes as $attribute => $value) {

            if('value' !== $attribute) {
                $html .= ' ' . $attribute . '="'. Escape :: attr($value) .'"';
            }
        }

        $html .= '>';

        $number = new Number();

        //Build options
        $maxsteps = (max($this -> min, $this -> max) - min($this -> min, $this -> max)) / $this -> steps;

        for($i = 0; $i <= $maxsteps; $i++) {

            //-1 to -2 && 1 to -1
            if($this -> max < 0 && $this -> min > $this -> max) {
                $key = $this -> min - $this -> steps * $i;
            }
            //-1 to 1 && -2 to -1
            elseif($this -> min < 0) {
                $key = $this -> min + $this -> steps * $i;
            }
            //0 to 1
            elseif($this -> min <= $this -> max) {
                $key = $this -> steps * $i;
            }
            //1 to 0
            else {
                $key = $this -> min - $this -> steps * $i;
            }

            $number -> set($key) -> toFixed($this -> round);

            $html .= '<option value="'. Escape :: attr($key) .'"';

            if((string) $key == $selected) {
                $html .= ' selected="selected"';
            }

            $html .= '>'. Escape :: html($number -> get()) .'</option>';              
        }
        
        $html .= '</select>';

        return $html;
    }