pimax\Messages\StructuredMessage::__construct PHP Метод

__construct() публичный Метод

StructuredMessage constructor.
public __construct ( string $recipient, string $type, array $data )
$recipient string
$type string
$data array
    public function __construct($recipient, $type, $data)
    {
        $this->recipient = $recipient;
        $this->type = $type;
        switch ($type) {
            case self::TYPE_BUTTON:
                $this->title = $data['text'];
                $this->buttons = $data['buttons'];
                break;
            case self::TYPE_GENERIC:
                $this->elements = $data['elements'];
                break;
            case self::TYPE_RECEIPT:
                $this->recipient_name = $data['recipient_name'];
                $this->order_number = $data['order_number'];
                $this->currency = $data['currency'];
                $this->payment_method = $data['payment_method'];
                $this->order_url = $data['order_url'];
                $this->timestamp = $data['timestamp'];
                $this->elements = $data['elements'];
                $this->address = $data['address'];
                $this->summary = $data['summary'];
                $this->adjustments = $data['adjustments'];
                break;
        }
    }
StructuredMessage