Change
+ Inheritance diagram for Change:

Description

The change on an event's resource.

See also
https://developers.asana.com/docs/event

Protected Properties

string string $key
 
const GRAPH
 Any payloads with types that are not present here will remain arrays. More...
 
- Protected Properties inherited from Data
readonly Api Api $api
 
array array self[] AbstractEntity[] $data = []
 
array bool[] $diff = []
 
const MAP = []
 

Public Methods

magic string getAction ()
 The change's action-verb. More...
 
magic string getField ()
 
null array Attachment FieldEntry Like Project Section Story Tag Task User getPayload ()
 The contents of the change. More...
 
bool hasPayload ()
 
bool wasAddition ()
 
bool wasRemoval ()
 
bool wasValue ()
 
- Public Methods inherited from Data
mixed __call (string $method, array $args)
 Magic method handler. More...
 
 __construct (Api|self $caller, array $data=[])
 
array __serialize ()
 
void __unserialize (array $data)
 
bool isDiff ()
 Whether the instance has changes. More...
 
array jsonSerialize ()
 
bool offsetExists (mixed $offset)
 
mixed offsetGet (mixed $offset)
 
void offsetSet (mixed $offset, mixed $value)
 
void offsetUnset (mixed $offset)
 
array toArray (bool $diff=false)
 Dehydrated data. More...
 

Protected Methods

void _setData (array $data)
 
- Protected Methods inherited from Data
mixed _get (string $field)
 Magic method: getField() More...
 
bool _has (string $field)
 Magic method: hasField() More...
 
_hydrate (string $class, $item)
 Sub-data factory that draws from the entity pool. More...
 
bool _is (string $field)
 Magic method: isField() More...
 
bool _of (string $resourceSubtype)
 Magic method: ofResourceSubtypeValue() More...
 
array _select (string|iterable $subject, callable $filter,... $args)
 Magic method: selectField(callable $filter) More...
 
$this _set (string $field, $value)
 Magic method: setField(mixed $value) More...
 
void _setField (string $field, $value)
 Sets a value, hydrating if mapped, and clears the diff. More...
 

Properties

◆ GRAPH

const GRAPH
protected
Initial value:
= [
Attachment::TYPE => Attachment::class,
CustomField::TYPE => FieldEntry::class,
Like::TYPE => Like::class,
Project::TYPE => Project::class,
ProjectTemplate::TYPE => ProjectTemplate::class,
Section::TYPE => Section::class,
Story::TYPE => Story::class,
Tag::TYPE => Tag::class,
Task::TYPE => Task::class,
User::TYPE => User::class,
]

Any payloads with types that are not present here will remain arrays.

Methods

◆ _setData()

void _setData ( array  $data)
protected
Parameters
array$data
Returns
void

Reimplemented from Data.

◆ getAction()

magic string getAction ( )

The change's action-verb.

Returns
string

◆ getField()

magic string getField ( )
Returns
string

◆ getPayload()

null array Attachment FieldEntry Like Project Section Story Tag Task User getPayload ( )

The contents of the change.

This is null for changes to scalar fields. You should reload the event's resource and check it.

Returns
null|array|Attachment|FieldEntry|Like|Project|Section|Story|Tag|Task|User

◆ hasPayload()

bool hasPayload ( )
final
Returns
bool

◆ wasAddition()

bool wasAddition ( )
final
Returns
bool

◆ wasRemoval()

bool wasRemoval ( )
final
Returns
bool

◆ wasValue()

bool wasValue ( )
final
Returns
bool