Build the document data with the appropriate method.

@return array
541402
public function getDocumentData()
    {
        // If the model contain a buildDocument function
        // use it to build the document
        if (method_exists($this, 'buildDocument')) {
            $document = $this->buildDocument();

            return $document;
        }
        // If a searchable array is provided build
        // the document from the given array
        elseif (is_array($this->searchable)) {
            $document = $this->buildDocumentFromArray($this->searchable);

            return $document;
        } else {
            $document = $this->toArray();

            return $document;
        }
    }
81244
public function buildProperties()
    {
        $methods            = get_class_methods($this);
        $properties         = get_object_vars($this);
        $filteredProperties = array();

        // only properties that have getters should be extracted
        foreach ($properties as $property => $value) {
            $getter = 'get' . $this->camelize($property, true);
            if (in_array($getter, $methods)) {
                $filteredProperties[$property] = $this->{$getter}();
            }
        }

        return $filteredProperties;
    }
575362
public function writeData(): array
    {
        $dataBuilder = new DataBuilder();
        $dataBuilder->setFloat('r', $this->getRed(), 1.)
                    ->setFloat('g', $this->getGreen(), 1.)
                    ->setFloat('b', $this->getBlue(), 1.)
                    ->setFloat('a', $this->getAlpha(), 1.);
        return $dataBuilder->getData();
    }
980797
public function writeData(): array
    {
        $dataBuilder = new DataBuilder();
        $dataBuilder->setString('n', $this->name, '')
                    ->setArray('l', $this->labels->writeData(), null, [])
                    ->setArray('d', $this->descriptions->writeData(), null, [])
                    ->setArray('c', array_values(array_unique($this->craftingCategories)), 'strval', [])
                    ->setFloat('s', $this->craftingSpeed, 1.)
                    ->setInteger('i', $this->numberOfItemSlots, 0)
                    ->setInteger('f', $this->numberOfFluidInputSlots, 0)
                    ->setInteger('u', $this->numberOfFluidOutputSlots, 0)
                    ->setInteger('m', $this->numberOfModuleSlots, 0)
                    ->setFloat('e', $this->energyUsage, 0.)
                    ->setString('r', $this->energyUsageUnit, 'W')
                    ->setString('o', $this->iconHash, '');
        return $dataBuilder->getData();
    }
391391
protected function build()
    {
        $operation = $this->buildOperation('ListProfiles');

        $merchantID = $this->document->createElement('merchantID', $this->merchantId);
        $operation->appendChild($merchantID);

        if ($this->customerId) {
            $xmlMPayTid = $this->document->createElement('customerID', $this->customerId);
            $operation->appendChild($xmlMPayTid);
        }

        if ($this->expiredBy) {
            $xmlMPayTid = $this->document->createElement('expiredBy', $this->expiredBy);
            $operation->appendChild($xmlMPayTid);
        }

        if ($this->begin) {
            $xmlMPayTid = $this->document->createElement('begin', $this->begin);
            $operation->appendChild($xmlMPayTid);
        }

        if ($this->size) {
            $xmlMPayTid = $this->document->createElement('size', $this->size);
            $operation->appendChild($xmlMPayTid);
        }
    }
285881
public function build()
    {
        $documentParser = $this->createDocumentParser();
        $stylesheetParser = new StylesheetParser();
        $stylesheetParser->setComplexAttributeFactory($this->configurationLoader->createComplexAttributeFactory());
        
        $engine = $this->engineFactory->createEngine($this->engineType, $this->engineOptions);

        $document = new Document($engine);
        $this->addStringFiltersTo($document);
        
        $facade = new Facade($this->configurationLoader, $document, $documentParser, $stylesheetParser);
        $this->addStringFiltersTo($facade);
        $facade->setEngineType($this->engineType);
        
        if($documentParser instanceof FacadeAware)
        {
            $documentParser->setFacade($facade);
        }
        
        $facade->setUseCacheForStylesheetConstraint($this->useCacheForStylesheetConstraint);

        if($this->cacheType && $this->cacheType !== 'Null')
        {
            $cache = new CacheImpl($this->cacheType, $this->cacheOptions);
            $facade->setCache($cache);
            
            if($this->useCacheForConfigurationLoader)
            {
                $this->configurationLoader->setCache($cache);
            }
        }

        return $facade;
    }
254795
protected function buildMethodMaps()
    {

        $getterMap = [];
        $setterMap = [];

        $methods = (new ReflectionObject($this))->getMethods(ReflectionMethod::IS_PUBLIC);

        foreach ($methods as $method) {

            if ($this->isGetter($method)) {
                $getterMap[$this->toPropertyName($method->getName())] = $method->getName();
                continue;
            }

            if ($this->isSetter($method)) {
                $setterMap[$this->toPropertyName($method->getName())] = $method->getName();
                continue;
            }


        }

        return [$getterMap, $setterMap];
    }
899671
public function enaDocumentFiles()
    {
        $properties = $this->getProperties();
        $extString  = (!empty($properties['acceptedFiles'])) ? $properties['acceptedFiles'] : '';
        $docsExts   = $this->getDocumentExtensionConstant();
        foreach ($docsExts as $docsExt) {
            if (strpos($extString, $docsExt) === false) {
                $extString .= ','.$docsExt;
            }
        }
        $extString                      = substr($extString, 1);
        $properties                     = $this->getProperties();
        $properties['acceptedFiles']    = $extString;
        $this->setProperties($properties);
        return $this;
    }
1156795
public function getDocuments()
    {
        $documents = [];
        foreach ($this->_results as $doc) {
            $documents[] = $doc->getDocument();
        }

        return $documents;
    }
1095382
public function Build()
    {
        $obj           = new \stdClass();
        $obj->metadata = $this->metadata;
        $obj->contents = $this->contents;

        return \json_encode($obj);
    }
102580
protected function buildView()
    {
        if (isset($this->html)) {
            return array_filter([
                'html' => new HtmlString($this->html),
                'text' => $this->textView ?? null,
            ]);
        }

        if (isset($this->markdown)) {
            return $this->buildMarkdownView();
        }

        if (isset($this->view, $this->textView)) {
            return [$this->view, $this->textView];
        } elseif (isset($this->textView)) {
            return ['text' => $this->textView];
        }

        return $this->view;
    }
503637
public function generate()
    {
        $code = array();

        $doc = $this->generateDocumentation();
        if ($doc !== null) {
            $code[] = $doc;
        }

        $propertyCode = $this->getIndentation() . $this->getVisibility() . ' ';
        if ($this->isStatic() === true) {
            $propertyCode .= 'static ';
        }

        $propertyCode .= '$' . $this->name;

        if ($this->defaultValue !== null && $this->defaultValue->getValue() !== null) {
            $propertyCode .= ' = ' . $this->defaultValue . ';';
        } else {
            $propertyCode .= ';';
        }

        $code[] = $propertyCode;

        return implode($this->getLineFeed(), $code);
    }
18621
protected function getData() {

        $sql = ['SELECT document FROM '.$this->collection->name];

        if ($this->criteria) {

            $sql[] = 'WHERE document_criteria("'.$this->criteria.'", document)';
        }

        if ($this->sort) {

            $orders = [];

            foreach ($this->sort as $field => $direction) {
                $orders[] = 'document_key("'.$field.'", document) '.($direction==-1 ? 'DESC':'ASC');
            }

            $sql[] = 'ORDER BY '.\implode(',', $orders);
        }

        if ($this->limit) {
            $sql[] = 'LIMIT '.$this->limit;

            if ($this->skip) { $sql[] = 'OFFSET '.$this->skip; }
        }

        $sql = implode(' ', $sql);

        $stmt      = $this->collection->database->connection->query($sql);
        $result    = $stmt->fetchAll( \PDO::FETCH_ASSOC);
        $documents = [];

        if (!$this->projection) {

            foreach ($result as &$doc) {
                $documents[] = \json_decode($doc['document'], true);
            }

        } else {

            $exclude = [];
            $include = [];

            foreach ($this->projection as $key => $value) {

                if ($value) {
                    $include[$key] = 1;
                } else {
                    $exclude[$key] = 1;
                }
            }

            foreach ($result as &$doc) {

                $item = \json_decode($doc['document'], true);
                $id   = $item['_id'];

                if ($exclude) {
                    $item = \array_diff_key($item, $exclude);
                }

                if ($include) {
                    $item = array_key_intersect($item, $include);
                }

                if (!isset($exclude['_id'])) {
                    $item['_id'] = $id;
                }

                $documents[] = $item;
            }
        }

        return $documents;
    }
723016
protected function buildDetails()
    {
        // 
        $details = array();

        // Extract document info
        if ($this->trailer->has('Info')) {
            /** @var PDFObject $info */
            $info = $this->trailer->get('Info');
            // This could be an ElementMissing object, so we need to check for
            // the getHeader method first.
            if ($info !== null && method_exists($info, 'getHeader')) {
                $details = $info->getHeader()->getDetails();
            }
        }

        // Retrieve the page count
        try {
            $pages = $this->getPages();
            $details['Pages'] = count($pages);
        } catch (\Exception $e) {
            $details['Pages'] = 0;
        }

        $this->details = $details;
    }
1000120
private function build() {

    	if(null === $this -> text) {

    		$html = '<input type="'. $this -> type .'"';
    		
    		foreach($this -> attributes as $attribute => $value) {
    		    $html .= ' ' . $attribute . '="'. Escape :: attr($value) .'"';
    		}

    		$html .= '>';

    		return $html;
    	}

        $this -> fill();
        
        $html = '<button';
        
        foreach($this -> attributes as $attribute => $value) {
            $html .= ' ' . $attribute . '="'. Escape :: attr($value) .'"';
        }

        $html .= '>' . Escape :: html($this -> text) . '</button>';

        return $html;
        
    }
1238997
protected function build()
    {
        $operation = $this->buildOperation('ManualReverse');

        $merchantID = $this->document->createElement('merchantID', $this->merchantId);
        $operation->appendChild($merchantID);

        $xmlMPayTid = $this->document->createElement('mpayTID', $this->mpayTid);
        $operation->appendChild($xmlMPayTid);
    }
964091
public function buildData()
    {
        $time = 0;
        foreach ($this->stack->queries as $query) {
            $time+= $query['executionMS'];
        }

        $this->data = [
            'count' => count($this->stack->queries),
            'time'  => $time
        ];
    }