\EasyWeChat\Kernel\TraitsHasAttributes

Trait Attributes.

Summary

Methods
Properties
Constants
setAttributes()
setAttribute()
getAttribute()
isRequired()
getRequired()
with()
set()
get()
has()
merge()
only()
all()
__call()
__get()
__set()
__isset()
No public properties found
No constants found
checkRequiredAttributes()
$attributes
$snakeable
N/A
No private methods found
No private properties found
N/A

Properties

$attributes

$attributes : array

Type

array

$snakeable

$snakeable : boolean

Type

boolean

Methods

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

__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

__isset()

__isset(string  $key) : boolean

Whether or not an data exists by key.

Parameters

string $key

Returns

boolean

checkRequiredAttributes()

checkRequiredAttributes() 

Check required attributes.

Throws

\EasyWeChat\Kernel\Exceptions\InvalidArgumentException