Builds message structure.

@return array Built message structure.
423403
public function build()
    {
        $areas = [];
        foreach ($this->areaBuilders as $areaBuilder) {
            $areas[] = $areaBuilder->build();
        }

        return [
            'size' => $this->sizeBuilder->build(),
            'selected' => $this->selected,
            'name' => $this->name,
            'chatBarText' => $this->chatBarText,
            'areas' => $areas,
        ];
    }
957332
protected function define_structure() {

        $paths = array();

        $logstore = new restore_path_element('logstore', '/logstores/logstore');
        $paths[] = $logstore;

        // Add logstore subplugin support to the 'logstore' element.
        $this->add_subplugin_structure('logstore', $logstore, 'tool', 'log');

        return array($logstore);
    }
960832
public function buildMessage()
    {
        if (!empty($this->message)) {
            return $this->message;
        }

        $actions = [];
        foreach ($this->imagemapActionBuilders as $builder) {
            $actions[] = $builder->buildImagemapAction();
        }

        $imagemapMessage = [
            'type' => MessageType::IMAGEMAP,
            'baseUrl' => $this->baseUrl,
            'altText' => $this->altText,
            'baseSize' => $this->baseSizeBuilder->build(),
            'actions' => $actions,
        ];

        if ($this->quickReply) {
            $imagemapMessage['quickReply'] = $this->quickReply->buildQuickReply();
        }

        if ($this->videoBuilder) {
            $imagemapMessage['video'] = $this->videoBuilder->build();
        }

        $this->message[] = $imagemapMessage;

        return $this->message;
    }
649421
public function getMessageTypes()
    {
        if ($this->messageTypes === null) {
            $this->messageTypes = array();
            $messageTypes = Mage::getConfig()->getNode(self::XML_PATH_MESSAGE_TYPES);
            if ($messageTypes) {
                foreach ($messageTypes->children() as $typeCode => $classAlias) {
                    $this->messageTypes[$typeCode] = (string)$classAlias;
                }
            }
        }

        return $this->messageTypes;
    }
1124922
public function buildMessage()
    {
        if (!empty($this->message)) {
            return $this->message;
        }

        $video = [
            'type' => MessageType::VIDEO,
            'originalContentUrl' => $this->originalContentUrl,
            'previewImageUrl' => $this->previewImageUrl,
        ];

        if ($this->quickReply) {
            $video['quickReply'] = $this->quickReply->buildQuickReply();
        }

        $this->message[] = $video;

        return $this->message;
    }
1190867
public function buildMessage()
    {
        if (!empty($this->message)) {
            return $this->message;
        }

        $audioMessage = [
            'type' => MessageType::AUDIO,
            'originalContentUrl' => $this->originalContentUrl,
            'duration' => $this->duration,
        ];

        if ($this->quickReply) {
            $audioMessage['quickReply'] = $this->quickReply->buildQuickReply();
        }

        $this->message[] = $audioMessage;

        return $this->message;
    }
766256
public function build()
    {
        $params = [
            'external_user_ids' => $this->externalUserIds,
            'segment_id' => $this->segmentId,
            'campaign_id' => $this->campaignId,
            'override_frequency_capping' => $this->overrideFrequencyCapping,
            'recipient_subscription_state' => $this->recipientSubscriptionState,
            'messages' => $this->messages,
        ];

        return array_filter($params, function ($param) {
            return $param !== null;
        });
    }
691645
public function build()
    {
        $params = [
            'badge' => $this->badge,
            'alert' => $this->alert,
            'sound' => $this->sound,
            'category' => $this->category,
            'expiry' => $this->expiryDate ? $this->expiryDate->format('c') : null,
            'custom_uri' => $this->uri,
            'message_variation_id' => $this->messageVariationId,
            'asset_url' => $this->assetUrl,
            'asset_file_type' => $this->assetFileType,
        ];

        if (!empty($this->extra)) {
            $params['extra'] = $this->extra;
        }

        return array_filter($params, function ($param) {
            return $param !== null;
        });
    }
528550
protected function buildStructuredHeaders(): void
    {
        $this->structuredHeaders = array();
        $headers = $this->entry[PoTokens::TRANSLATED];
        $headers = ($headers === null) ? array() : $headers;
        $full = implode('', $headers);
        $headers = explode("\n", $full);
        // split on ':'
        $pattern = '/([a-z0-9\-]+):\s*(.*)/i';
        foreach ($headers as $h) {
            if (preg_match($pattern, trim($h), $matches)) {
                $this->structuredHeaders[strtolower($matches[1])] = array(
                    'key' => $matches[1],
                    'value' => $matches[2],
                );
            }
        }
    }
151174
public function generate()
    {
        if (true === empty($this->log)) {
            return array();
        }

        $log = array();

        // Iterate over grouped entries
        foreach ($this->log as $header => &$entries) {

            // Add a group header (e.g. Bugfixes)
            $log[] = sprintf("\n#### %s", $header);

            // Iterate over entries
            foreach ($entries as &$line) {
                $message = explode(VCS::MSG_SEPARATOR, $line);

                $log[] = sprintf("* %s", trim($message[0]));

                // Include multi-line entries
                if (true === isset($message[1])) {
                    $log[] = sprintf("\n  %s", trim($message[1]));
                }
            }
        }

        // Return a write-ready log
        return array_merge(array("## {$this->release}", "*({$this->date->format('Y-m-d')})*"), $log, array("\n---\n"));
    }
1319707
public function getMessages()
    {
        $messages = array();
        foreach ($this->_fields as $fieldName => $values) {
            if (! $values['isValid']) {
                $invalidators = array();
                foreach ($values['validators'] as $validatorName => $validatorValue) {
                    if (! $validatorValue) {
                        $invalidators[] = $validatorName;
                    }
                }
                $messages[$fieldName] = $invalidators;
                unset($validator);
            }
            unset($fieldName);
            unset($values);
        }
        return $messages;
    }
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;
    }
1350116
public function getStructures()
    {
        $structures = [];
        foreach ($this->nodeHelper->getLanguagesForNode($this->node) as $locale) {
            $structures[] = $this->getStructure($locale);
        }

        return $structures;
    }
1059189
public function buildMessage()
    {
        if (!empty($this->message)) {
            return $this->message;
        }

        foreach ($this->texts as $text) {
            $this->message[] = [
                'type' => MessageType::TEXT,
                'text' => $text,
            ];
        }

        if ($this->quickReply) {
            $lastKey = count($this->message) - 1;

            // If the user receives multiple message objects.
            // The quickReply property of the last message object is displayed.
            $this->message[$lastKey]['quickReply'] = $this->quickReply->buildQuickReply();
        }

        return $this->message;
    }
316858
public function buildMessage()
    {
        if (!empty($this->message)) {
            return $this->message;
        }

        $locationMessage = [
            'type' => MessageType::LOCATION,
            'title' => $this->title,
            'address' => $this->address,
            'latitude' => $this->latitude,
            'longitude' => $this->longitude,
        ];

        if ($this->quickReply) {
            $locationMessage['quickReply'] = $this->quickReply->buildQuickReply();
        }

        $this->message[] = $locationMessage;

        return $this->message;
    }
344213
public function messages()
    {
        $messages = [];
        $instances = $this->parents(true);
        foreach ($instances as $instance) {
            $messages[] = $instance->message();
        }
        return $messages;
    }
1011657
protected static function buildStructures()
    {
		$perspectives = array();
		$toAdd = array();
		$sorted = \helpers_ExtensionHelper::sortByDependencies(\common_ext_ExtensionsManager::singleton()->getEnabledExtensions());
		foreach(array_keys($sorted) as $extId){
			$file = self::getStructuresFilePath($extId);
			if(!is_null($file)){
			    $xmlStructures = new \SimpleXMLElement($file, null, true);
				$extStructures = $xmlStructures->xpath("/structures/structure");
				foreach($extStructures as $xmlStructure){
				    $perspective = Perspective::fromSimpleXMLElement($xmlStructure, $extId);
				    if (!isset($perspectives[$perspective->getId()])) {
				        $perspectives[$perspective->getId()] = $perspective;
				    } else {
				        foreach ($perspective->getChildren() as $section) {
				            $perspectives[$perspective->getId()]->addSection($section);
				        }
				    }
				}
				foreach($xmlStructures->xpath("/structures/toolbar/toolbaraction") as $xmlStructure){
				    $perspective = Perspective::fromLegacyToolbarAction($xmlStructure, $extId);
			        $perspectives[$perspective->getId()] = $perspective;
			        if (isset($xmlStructure['structure'])) {
			            $toAdd[$perspective->getId()] = (string)$xmlStructure['structure'];  
			        }
				}
			}
		}
		
		foreach ($toAdd as $to => $from) {
		    if (isset($perspectives[$from]) && isset($perspectives[$to])) {
		        foreach($perspectives[$from]->getChildren() as $section) {
		            $perspectives[$to]->addSection($section);
		        }
		    } 
		}

        usort($perspectives, function ($a, $b) {
            return $a->getLevel() - $b->getLevel();
        });

		return array(
			'perspectives' => $perspectives
		);
    }