protected function createMessage($body)
    {
        $message = new models\DbMessage();
        $message->setAttributes([
            'queue_id'  => $this->id,
            'timeout'   => $this->timeout,
            'sender_id' => Yii::$app->has('user') ? Yii::$app->user->getId() : null,
            'status'    => Message::AVAILABLE,
            'body'      => $body,
        ], false);

        return $this->formatMessage($message);
    }
protected function createMessage($body)
    {
        $message = new models\DbMessage();
        $message->setAttributes([
            'queue_id'  => $this->id,
            'timeout'   => $this->timeout,
            'sender_id' => Yii::$app->has('user') ? Yii::$app->user->getId() : null,
            'status'    => Message::AVAILABLE,
            'body'      => $body,
        ], false);

        return $this->formatMessage($message);
    }
protected function createMessage ( $ body ) { $ message = new models \ DbMessage ( ) ; $ message -> setAttributes ( [ 'queue_id' => $ this -> id , 'timeout' => $ this -> timeout , 'sender_id' => Yii :: $ app -> has ( 'user' ) ? Yii :: $ app -> user -> getId ( ) : null , 'status' => Message :: AVAILABLE , 'body' => $ body , ] , false ) ; return $ this -> formatMessage ( $ message ) ; }
Creates an instance of DbMessage model. The passed message body may be modified, @see formatMessage().
This method may be overriden in extending classes.
@param  string    $body message body
@return models\DbMessage
Creates an instance of DbMessage model . The passed message body may be modified