Retrieves document data for a specific order and adds it to the entries.

@param array $options

@throws \Sulu\Bundle\AdminBundle\Widgets\WidgetParameterException
332481
protected function fetchDocumentData($options)
    {
        $documents = $this->dependencyManager->getDocuments($options['orderId'], $options['locale']);
        if (!empty($documents)) {
            /* @var SalesDocument $document */
            foreach ($documents as $document) {
                $data = $document->getSalesDocumentData();
                parent::addEntry(
                    $this->getProperty($data, 'id'),
                    $this->getProperty($data, 'number'),
                    $this->getProperty($data, 'icon'),
                    $this->getProperty($data, 'date'),
                    parent::getRoute($data['id'], $data['type'], 'details'),
                    $this->getProperty($data, 'pdfBaseUrl'),
                    $this->getProperty($data, 'translationKey')
                );
            }
        }
    }
163817
public function addOptions(array $options)
    {
        $this->options = array_merge($this->options, $options);

        $this->getDefinitionLoader()->setOptions($options);
    }
983923
public function getData($options)
    {
        if (!empty($options) &&
            array_key_exists('status', $options) &&
            !empty($options['status'])
        ) {
            $data = [];
            $data['status'] = $options['status'];

            if(array_key_exists('date', $options) &&
                !empty($options['date'])){
                $data['date'] = $options['date'];
            }

            return $data;
        } else {
            throw new WidgetParameterException(
                'Required parameter status not found or empty!',
                $this->widgetName,
                'status'
            );
        }
    }
987687
protected function postOptions(array $options)
    {
        $this->manager = new RedisManager(
            $this->app, Arr::pull($options, 'client', 'predis'), $options
        );
    }
465679
public function setOptions(array $options)
	{
		foreach ($options as $value => $text) {
			$this->addOption($value, $text);
		}

		return $this;
	}
1356180
public function addOptions(array $options) : Select
    {
        foreach ($options as $value => $content) {
            $this->addOption($content, $value);
        }

        return $this;
    }
526324
public function setFormatOptions(array $options)
    {
        foreach ($options as $name => $handler) {
            $this->setFormatOption($name, $handler);
        }
        return $this;
    }
583649
private function addCustomerData($options)
    {
        $this->post->addChild('Customer_Ref', $options->customer);
        $this->post->addChild('Client_IP', $options->ip);
        $this->post->addChild('Client_Email', $options->email);
    }
440443
public function select($options = [])
    {
        $source = [];

        foreach ($options as $key => $value) {
            $source[] = [
                'value' => $key,
                'text' => $value,
            ];
        }

        $this->addOptions(['source' => $source]);
    }
536960
public function getData($options)
    {
        $this->checkRequiredParameters($options, [$this->optionsIdKey]);

        $transitions = $this->transitionResolver->getTransitions(
            $this->transitionKey,
            $options[$this->optionsIdKey]
        );

        /** @var TransitionResultInterface $transition */
        if (isset($transitions['previous'])) {
            foreach ($transitions['previous'] as $transition) {
                $this->addTransitionToEntries($transition);
            }
        }

        /** @var TransitionResultInterface $transition */
        $transition = $transitions['current'];
        $this->addTransitionToEntries($transition);

        if (isset($transitions['following'])) {
            /** @var TransitionResultInterface $transition */
            foreach ($transitions['following'] as $transition) {
                $this->addTransitionToEntries($transition);
            }
        }

        return parent::serializeData();
    }
137592
public function insertOne($document, $options = [])
    {
        $query = new InsertOne($this->documentManager, $this, $document, $options);
        if (isset($options['getQuery']) && $options['getQuery']) {
            return $query;
        } else {
            return $query->execute();
        }
    }
667730
private function addInvoice($options)
    {
        $this->post->addChild('Reference_No', $options->order_id);
        $this->post->addChild('Reference_3', $options->description);

    }
410374
protected function checkRequiredParameters(array $options = null, $requiredParameters = [])
    {
        if (empty($options)) {
            throw new WidgetException('No params found!', $this->getName());
        }

        foreach ($requiredParameters as $parameter) {
            if (empty($options[$parameter])) {
                throw new WidgetParameterException(
                    'Required parameter ' . $parameter . ' not found or invalid!',
                    $this->widgetName,
                    $parameter
                );
            }
        }
    }
297569
public function getArray(array $options = array()): array
    {
        $content = $this->getContent();

        if (is_null($content)) {
            return (array)$content;
        }

        return json_decode($this->content, true);
    }
25387
public function addDocuments(array $options = [])
    {
        $resolver = new OptionsResolver();
        $resolver->setDefaults([
            "add_content_div" => false,
            "template" => $this->options["document_manager"]["template"],
            "title" => $this->trans("messages.tab.documents", [], "messages"),
            "icon" => "vf vf-documents",
        ]);
        $options = $resolver->resolve($options);
        $tabContentDocuments = new TabContent($options);
        $this->tab->addTabContent($tabContentDocuments);
        $folder = "uploaded";
        $this->getObjectDataManager()->documents()->folder($folder);
        $this->parametersToView["parameters_to_route"]["_conf"]["folder"] = $folder;
//        $this->parametersToView["form"] = function(){
//            
//        };
        $this->parametersToView["form"] = $this->createForm(DocumentsType::class)->createView();
    }
101738
protected function options(array $options = null)
    {
        $dataOptions = $this->options;

        if ($options)
        {
            $dataOptions = $this->merge($dataOptions, $options);
        }

        return $dataOptions;
    }
630263
public function create($document, $options = null)
    {
        $this->assertProperties($document, ['_type'], 'create');
        return $this->createDocument($document, 'create', $options);
    }