class Attribute

Properties

null|callable $get

The attribute accessor.

null|callable $set

The attribute mutator.

bool $withCaching

Indicates if caching is enabled for this attribute.

bool $withObjectCaching

Indicates if caching of objects is enabled for this attribute.

Methods

__construct(callable|null $get = null, callable|null $set = null)

Create a new attribute accessor / mutator.

static Attribute
make(callable|null $get = null, callable|null $set = null)

Create a new attribute accessor / mutator.

static Attribute
get(callable $get)

Create a new attribute accessor.

static Attribute
set(callable $set)

Create a new attribute mutator.

withoutObjectCaching()

Disable object caching for the attribute.

shouldCache()

Enable caching for the attribute.

Details

at line 36
__construct(callable|null $get = null, callable|null $set = null)

Create a new attribute accessor / mutator.

Parameters

callable|null $get
callable|null $set

at line 45
static Attribute make(callable|null $get = null, callable|null $set = null)

Create a new attribute accessor / mutator.

Parameters

callable|null $get
callable|null $set

Return Value

Attribute

at line 53
static Attribute get(callable $get)

Create a new attribute accessor.

Parameters

callable $get

Return Value

Attribute

at line 61
static Attribute set(callable $set)

Create a new attribute mutator.

Parameters

callable $set

Return Value

Attribute

at line 69
Attribute withoutObjectCaching()

Disable object caching for the attribute.

Return Value

Attribute

at line 79
Attribute shouldCache()

Enable caching for the attribute.

Return Value

Attribute