Create a new Message from this instance.

@return Message
4341
public function toMessage()
    {
        $m = new Message();
        foreach ($this->queueStatus as $action) {
            $m->push($action['action']);
            $m->push($action['queue']);
            $m->push($action['busy']);
            $m->push($action['available']);
        }

        return $m;
    }
567528
protected function createOutgoingMessage()
    {
        $message = new OutgoingMessage($this->container['view']);

        //If a from address is set, pass it along to the message class.
        if (isset($this->from)) {
            $message->from($this->from);
        }

        return $message;
    }
874269
protected function createNewObject()
    {
        $jwkset = new JWKSet();
        for ($i = 0; $i < $this->nb_keys; ++$i) {
            $key = $this->createJWK();
            $jwkset->addKey($key);
        }

        return $jwkset;
    }
537106
public function create(): self
    {
        $this->payload = null;
        $this->isPayloadDetached = false;
        $this->signatures = [];
        $this->isPayloadEncoded = null;

        return $this;
    }
530353
@Override
    public Message newMessage(final Object message) {
        final ReusableObjectMessage result = getObject();
        result.set(message);
        return result;
    }
1352523
public function messageBoard()
    {
        $messageBoard = collect($this->dock)->where('name', 'message_board')
                                            ->first();
        $messageBoard->bucket = $this;
        return new MessageBoard($messageBoard);
    }
1082865
public function newAction()
        {

            $oRemoteApp = new RemoteApp();
            $oRemoteApp->setApiUrl("swControl/");
            $oRemoteApp->setActivated(true);
            $oRemoteApp->setIncludelog(true);
            $oRemoteApp->setNotificationRecipient($this->getUser()->getEmail());
            $oRemoteApp->setNotificationSender($this->getUser()->getEmail());
            $oRemoteApp->setNotificationChange(true);
            $oRemoteApp->setNotificationError(true);
            $form = $this->createCreateForm($oRemoteApp);

            return $this->render('SlashworksAppBundle:RemoteApp:new.html.twig', array(
                'entity' => $oRemoteApp,
                'form'   => $form->createView(),
            ));
        }
303244
public function createJsMessages()
    {
        $contents = $this->getMessagesJson();

        return response($contents)
            ->header('Content-Type', 'text/javascript')
            ->setLastModified(MessageCachingService::getLastRefreshTimestamp());
    }
558606
private function create()
    {
        $response = $this->sendRequest(
            self::METHOD_POST,
            self::$endPoints['create'],
            $this->requestData
        );
        $this->resetRequestData();
        return $response;
    }
342121
public function buildMessage()
    {
        if (!empty($this->message)) {
            return $this->message;
        }

        $imageMessage = [
            'type' => MessageType::IMAGE,
            'originalContentUrl' => $this->originalContentUrl,
            'previewImageUrl' => $this->previewImageUrl,
        ];

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

        $this->message[] = $imageMessage;

        return $this->message;
    }
839704
public function create()
    {
        $this->assertPathIsSet();
        $this->assertNotExists();
        $this->doCreate();
        $this->setPermissions();

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

        $sticker = [
            'type' => MessageType::STICKER,
            'packageId' => $this->packageId,
            'stickerId' => $this->stickerId,
        ];

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

        $this->message[] = $sticker;

        return $this->message;
    }
171116
public function toMessage()
    {
        $msg = new Message(array(
                $this->requestId,
                $this->action,
            ));

        $msg->append($this->params);

        return $msg;
    }
841738
@Override
    public Message newMessage(final String message) {
        final ReusableSimpleMessage result = getSimple();
        result.set(message);
        return result;
    }
863165
public function toMessage()
    {
        $msg = parent::createMessage();
        $msg->append(array(count($this->actions)));
        $msg->append($this->actions);

        return $msg;
    }
633506
public static function make($rules = [], $message = [])
    {
        if (is_null(self::$instance)) {
            self::$instance = new self($rules, $message);
        }
        return self::$instance;
    }
1018466
protected function createMessage()
    {
        $message = new Message(new Swift_Message);

        // If a global from address has been specified we will set it on every message
        // instances so the developer does not have to repeat themselves every time
        // they create a new message. We will just go ahead and push the address.
        if (isset($this->from['address'])) {
            $message->from($this->from['address'], $this->from['name']);
        }

        return $message;
    }