Constants

TEXT

TEXT = 2

IMAGE

IMAGE = 4

VOICE

VOICE = 8

VIDEO

VIDEO = 16

SHORT_VIDEO

SHORT_VIDEO = 32

LOCATION

LOCATION = 64

DEVICE_EVENT

DEVICE_EVENT = 256

DEVICE_TEXT

DEVICE_TEXT = 512

FILE

FILE = 1024

TEXT_CARD

TEXT_CARD = 2048

TRANSFER

TRANSFER = 4096

EVENT

EVENT = 1048576

MINIPROGRAM_PAGE

MINIPROGRAM_PAGE = 2097152

ALL

ALL = 1049598

Properties

$title

$title : string

Type

string

$media_id

$media_id : string

Type

string

$description

$description : string

Type

string

$thumb_media_id

$thumb_media_id : string

Type

string

$video

$video : string

Type

string

$title

$title : string

Type

string

$media_id

$media_id : string

Type

string

$description

$description : string

Type

string

$thumb_media_id

$thumb_media_id : string

Type

string

$type

$type : string

Messages type.

Type

string

$properties

$properties : array

Type

array

$required

$required : array

Type

array

$id

$id : integer

Type

integer

$to

$to : string

Type

string

$from

$from : string

Type

string

$jsonAliases

$jsonAliases : array

Type

array

$attributes

$attributes : array

Type

array

$snakeable

$snakeable : boolean

Type

boolean

Methods

__construct()

__construct(array  $attributes = array()) 

Message constructor.

Parameters

array $attributes

toXmlArray()

toXmlArray() 

getMediaId()

getMediaId() : string

Returns

string

getType()

getType() : string

Return type name message.

Returns

string

setType()

setType(string  $type) 

Parameters

string $type

__get()

__get(string  $property) : mixed

Magic get.

Parameters

string $property

Returns

mixed

__set()

__set(string  $property, mixed  $value) : $this

Magic set.

Parameters

string $property
mixed $value

Returns

$this

transformForJsonRequestWithoutType()

transformForJsonRequestWithoutType(array  $appends = array()) : array

Parameters

array $appends

Returns

array

transformForJsonRequest()

transformForJsonRequest(array  $appends = array(), boolean  $withType = true) : array

Parameters

array $appends
boolean $withType

Returns

array

transformToXml()

transformToXml(array  $appends = array(), boolean  $returnAsArray = false) : string

Parameters

array $appends
boolean $returnAsArray

Returns

string

setAttributes()

setAttributes(array  $attributes = array()) : $this

Set Attributes.

Parameters

array $attributes

Returns

$this

setAttribute()

setAttribute(string  $attribute, string  $value) : $this

Set attribute.

Parameters

string $attribute
string $value

Returns

$this

getAttribute()

getAttribute(string  $attribute, mixed  $default = null) : mixed

Get attribute.

Parameters

string $attribute
mixed $default

Returns

mixed

isRequired()

isRequired(string  $attribute) : boolean

Parameters

string $attribute

Returns

boolean

getRequired()

getRequired() : array|mixed

Returns

array|mixed

with()

with(string  $attribute, mixed  $value) : $this

Set attribute.

Parameters

string $attribute
mixed $value

Returns

$this

set()

set(string  $attribute, mixed  $value) : $this

Override parent set() method.

Parameters

string $attribute
mixed $value

Returns

$this

get()

get(string  $attribute, mixed  $default = null) : mixed

Override parent get() method.

Parameters

string $attribute
mixed $default

Returns

mixed

has()

has(string  $key) : boolean

Parameters

string $key

Returns

boolean

merge()

merge(array  $attributes) : $this

Parameters

array $attributes

Returns

$this

only()

only(array|string  $keys) : array

Parameters

array|string $keys

Returns

array

all()

all() : array

Return all items.

Returns

array

__call()

__call(string  $method, array  $args) : $this

Magic call.

Parameters

string $method
array $args

Returns

$this

__isset()

__isset(string  $key) : boolean

Whether or not an data exists by key.

Parameters

string $key

Returns

boolean

propertiesToArray()

propertiesToArray(array  $data, array  $aliases = array()) : array|mixed

Parameters

array $data
array $aliases

Throws

\EasyWeChat\Kernel\Exceptions\InvalidArgumentException

Returns

array|mixed

checkRequiredAttributes()

checkRequiredAttributes() 

Check required attributes.

Throws

\EasyWeChat\Kernel\Exceptions\InvalidArgumentException