class ButtonTemplate extends Template (View source)

Class ButtonTemplate

Traits

Class Quickable

Constants

TYPE_IMAGE

Image type

TYPE_AUDIO

Audio type

TYPE_VIDEO

Video type

TYPE_FILE

File type

TYPE_LOCATION

Location type

TYPE_TEMPLATE

Template type

Properties

protected QuickReplyCollection $quicks from Quickable
protected BaseCollection $collections from Template

Methods

__construct($sender, string $text = '', array $elements = [])

Button constructor.

mixed
getSender()

Get sender id

from Message
array
toData()

To array for send api

array
getPayload()

Get payload

$this
setPayload(array $payload)

Set Payload

$this
enableReuse()

Enable reuse

$this
disableReuse()

Disable reuse

$this
setAttachmentId($id)

Set attachment id

bootQuick()

Boot quick

from Quickable
$this
addQuick($quick)

No description

from Quickable
bool
isEmpty()

No description

from Quickable
array
makeQuickReply($data = [])

No description

from Quickable
$this
add($elements)

Add elements

from Template
mixed
__call($name, $arguments)

No description

from Template
getCollections()

Get collection

from Template
$this
disableShare()

Disable share

from Template
mixed
collection()

Get button collection

setText(string $text)

Set text

string
getText()

Get text

Details

__construct($sender, string $text = '', array $elements = [])

Button constructor.

Parameters

$sender
string $text
array $elements

mixed getSender()

Get sender id

Return Value

mixed

array toData()

To array for send api

Return Value

array

Exceptions

RequiredArgumentException

array getPayload()

Get payload

Return Value

array

$this setPayload(array $payload)

Set Payload

Parameters

array $payload

Return Value

$this

$this enableReuse()

Enable reuse

Return Value

$this

$this disableReuse()

Disable reuse

Return Value

$this

$this setAttachmentId($id)

Set attachment id

Parameters

$id

Return Value

$this

bootQuick()

Boot quick

$this addQuick($quick)

Parameters

$quick

Return Value

$this

bool isEmpty()

Return Value

bool

array makeQuickReply($data = [])

Parameters

$data

Return Value

array

$this add($elements)

Add elements

Parameters

$elements

Return Value

$this

mixed __call($name, $arguments)

Parameters

$name
$arguments

Return Value

mixed

BaseCollection getCollections()

Get collection

Return Value

BaseCollection

$this disableShare()

Disable share

Return Value

$this

protected mixed collection()

Get button collection

Return Value

mixed

ButtonTemplate setText(string $text)

Set text

Parameters

string $text

Return Value

ButtonTemplate

string getText()

Get text

Return Value

string