EnumOption
+ Inheritance diagram for EnumOption:

Description

A custom field enum option.

Enum options cannot be deleted.

See also
https://developers.asana.com/docs/create-an-enum-option
https://developers.asana.com/docs/enum-option

Public Properties

final const TYPE = 'enum_option'
 
- Public Properties inherited from AbstractEntity
const TYPE = ''
 All entity classes must redeclare this to match their resource_type. More...
 

Protected Properties

final const DIR = 'enum_options'
 
- Protected Properties inherited from AbstractEntity
const DIR = ''
 All entity classes must redeclare this to match their REST directory. More...
 
const OPT_FIELDS = []
 
- Protected Properties inherited from Data
readonly Api Api $api
 
array array self[] AbstractEntity[] $data = []
 
array bool[] $diff = []
 
const MAP = []
 

Public Methods

 __construct (CustomField|FieldEntry $caller, array $data=[])
 
$this create ()
 
magic string getColor ()
 
CustomField getCustomField ()
 
magic string getName ()
 
magic bool isEnabled ()
 
$this moveAbove (EnumOption $option)
 Move above another option. More...
 
$this moveBelow (EnumOption $option)
 Move below another option. More...
 
$this moveFirst ()
 Make the option first. More...
 
$this moveLast ()
 Make the option last. More...
 
magic $this setColor (string $color)
 
magic $this setEnabled (bool $enabled)
 
magic $this setName (string $name)
 
- Public Methods inherited from AbstractEntity
string __toString ()
 The entity's canonical REST path. More...
 
null string getGid ()
 
bool hasGid ()
 
$this reload ()
 Fully reloads the entity from Asana. More...
 
- 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...
 
- Public Methods inherited from ImmutableArrayTrait
void offsetSet (mixed $offset, mixed $value)
 Throws unless overridden. More...
 
- Public Methods inherited from UpdateTrait
$this update ()
 PUT the data diff to Asana, if there is one. More...
 

Protected Methods

CustomField _getParentNode ()
 
- Protected Methods inherited from AbstractEntity
mixed _get (string $field)
 Lazy-loads missing fields. More...
 
void _reload (string $field)
 
void _setData (array $data)
 
- Protected Methods inherited from Data
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...
 

Constructor

◆ __construct()

__construct ( CustomField|FieldEntry  $caller,
array  $data = [] 
)
Parameters
CustomField | FieldEntry$caller
array$data

Methods

◆ _getParentNode()

CustomField _getParentNode ( )
finalprotected
Returns
CustomField

Reimplemented from CreateTrait.

◆ create()

$this create ( )
Returns
$this

Reimplemented from CreateTrait.

◆ getColor()

magic string getColor ( )
Returns
string

◆ getCustomField()

CustomField getCustomField ( )
Returns
CustomField

◆ getName()

magic string getName ( )
Returns
string

◆ isEnabled()

magic bool isEnabled ( )
Returns
bool

◆ moveAbove()

$this moveAbove ( EnumOption  $option)

Move above another option.

See also
https://developers.asana.com/docs/reorder-a-custom-fields-enum
Parameters
EnumOption$option
Returns
$this

◆ moveBelow()

$this moveBelow ( EnumOption  $option)

Move below another option.

See also
https://developers.asana.com/docs/reorder-a-custom-fields-enum
Parameters
EnumOption$option
Returns
$this

◆ moveFirst()

$this moveFirst ( )

Make the option first.

Returns
$this

◆ moveLast()

$this moveLast ( )

Make the option last.

Returns
$this

◆ setColor()

magic $this setColor ( string  $color)
Returns
$this

◆ setEnabled()

magic $this setEnabled ( bool  $enabled)
Returns
$this

◆ setName()

magic $this setName ( string  $name)
Returns
$this