CustomField
+ Inheritance diagram for CustomField:

Description

Public Properties

final const FORMAT_CURRENCY = 'currency'
 
final const FORMAT_CUSTOM = 'custom'
 
final const FORMAT_IDENTIFIER = 'identifier'
 
final const FORMAT_NONE = 'none'
 
final const FORMAT_PERCENTAGE = 'percentage'
 
final const POSITION_PREFIX = 'prefix'
 
final const POSITION_SUFFIX = 'suffix'
 
final const TYPE = 'custom_field'
 
- Public Properties inherited from AbstractEntity
const TYPE = ''
 All entity classes must redeclare this to match their resource_type. More...
 

Protected Properties

final const DIR = 'custom_fields'
 
const MAP
 
- 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

magic User getCreatedBy ()
 
magic null string getCurrencyCode ()
 ISO 4217. More...
 
magic null string getCustomLabel ()
 null unless format is custom More...
 
magic string getCustomLabelPosition ()
 See the position constants. More...
 
magic string getDescription ()
 
null EnumOption getEnumOption (string $ident)
 
magic EnumOption[] getEnumOptions ()
 
magic string getFormat ()
 See the format constants. More...
 
magic string getName ()
 
magic int getPrecision ()
 
magic string getResourceSubtype ()
 
bool hasNotificationsEnabled ()
 
bool isCurrency ()
 
magic bool isEnabled ()
 
bool isGlobalToWorkspace ()
 
bool isIdentifier ()
 
bool isPercentage ()
 
EnumOption newEnumOption ()
 
magic bool ofDate ()
 
magic bool ofEnum ()
 
magic bool ofMultiEnum ()
 
magic bool ofNumber ()
 
magic bool ofPeople ()
 
magic bool ofText ()
 
magic EnumOption[] selectEnumOptions (callable $filter)
 fn( EnumOption $option ): bool More...
 
magic $this setCurrencyCode (string $iso4217)
 Requires subtype=number, format=currency More...
 
magic $this setCustomLabel (string $label)
 Requires format=custom More...
 
magic $this setCustomLabelPosition (string $position)
 See the position constants. More...
 
magic $this setDescription (string $text)
 
magic $this setFormat (string $format)
 See the format constants. More...
 
$this setGlobalToWorkspace (bool $global)
 
magic $this setName (string $name)
 
$this setNotificationsEnabled (bool $enabled)
 
magic $this setPrecision (int $precision)
 
magic $this setResourceSubtype (string $type)
 
magic $this setWorkspace (Workspace $workspace)
 
$this sortEnumOptions (callable $cmp)
 
- 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 CreateTrait
$this create ()
 Creates the new entity in Asana. More...
 
- Public Methods inherited from UpdateTrait
$this update ()
 PUT the data diff to Asana, if there is one. More...
 
- Public Methods inherited from DeleteTrait
void delete ()
 Deletes the entity from Asana. More...
 

Protected Methods

null _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...
 
- Protected Methods inherited from PostMutatorTrait
$this _addWithPost (string $addPath, array $postData, string $field, array $diff)
 For existing entities this adds references to other entities via the given POST path. More...
 
$this _removeWithPost (string $rmPath, array $postData, string $field, array|Closure $diff)
 For existing entities this removes references to other entities via the given POST path. More...
 

Properties

◆ MAP

const MAP
protected
Initial value:
= [
'created_by' => User::class,
'enum_options' => [EnumOption::class],
]

Methods

◆ _getParentNode()

null _getParentNode ( )
finalprotected
Returns
null

Reimplemented from CreateTrait.

◆ getCreatedBy()

magic User getCreatedBy ( )
Returns
User

◆ getCurrencyCode()

magic null string getCurrencyCode ( )

ISO 4217.

Returns
null|string

◆ getCustomLabel()

magic null string getCustomLabel ( )

null unless format is custom

Returns
null|string

◆ getCustomLabelPosition()

magic string getCustomLabelPosition ( )

See the position constants.

Returns
string

◆ getDescription()

magic string getDescription ( )
Returns
string

◆ getEnumOption()

null EnumOption getEnumOption ( string  $ident)
Parameters
string$identGID or name.
Returns
null|EnumOption

◆ getEnumOptions()

magic EnumOption [] getEnumOptions ( )
Returns
EnumOption[]

◆ getFormat()

magic string getFormat ( )

See the format constants.

Returns
string

◆ getName()

magic string getName ( )
Returns
string

◆ getPrecision()

magic int getPrecision ( )
Returns
int

◆ getResourceSubtype()

magic string getResourceSubtype ( )
Returns
string

◆ hasNotificationsEnabled()

bool hasNotificationsEnabled ( )
final
Returns
bool

◆ isCurrency()

bool isCurrency ( )
final
Returns
bool

◆ isEnabled()

magic bool isEnabled ( )
Returns
bool

◆ isGlobalToWorkspace()

bool isGlobalToWorkspace ( )
final
Returns
bool

◆ isIdentifier()

bool isIdentifier ( )
final
Returns
bool

◆ isPercentage()

bool isPercentage ( )
final
Returns
bool

◆ newEnumOption()

EnumOption newEnumOption ( )
Returns
EnumOption

◆ ofDate()

magic bool ofDate ( )
Returns
bool

◆ ofEnum()

magic bool ofEnum ( )
Returns
bool

◆ ofMultiEnum()

magic bool ofMultiEnum ( )
Returns
bool

◆ ofNumber()

magic bool ofNumber ( )
Returns
bool

◆ ofPeople()

magic bool ofPeople ( )
Returns
bool

◆ ofText()

magic bool ofText ( )
Returns
bool

◆ selectEnumOptions()

magic EnumOption [] selectEnumOptions ( callable  $filter)

fn( EnumOption $option ): bool

Returns
EnumOption[]

◆ setCurrencyCode()

magic $this setCurrencyCode ( string  $iso4217)

Requires subtype=number, format=currency

Returns
$this

◆ setCustomLabel()

magic $this setCustomLabel ( string  $label)

Requires format=custom

Returns
$this

◆ setCustomLabelPosition()

magic $this setCustomLabelPosition ( string  $position)

See the position constants.

Returns
$this

◆ setDescription()

magic $this setDescription ( string  $text)
Returns
$this

◆ setFormat()

magic $this setFormat ( string  $format)

See the format constants.

Returns
$this

◆ setGlobalToWorkspace()

$this setGlobalToWorkspace ( bool  $global)
final
Parameters
bool$global
Returns
$this

◆ setName()

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

◆ setNotificationsEnabled()

$this setNotificationsEnabled ( bool  $enabled)
final
Parameters
bool$enabled
Returns
$this

◆ setPrecision()

magic $this setPrecision ( int  $precision)
Returns
$this

◆ setResourceSubtype()

magic $this setResourceSubtype ( string  $type)
Depends:
create-only, see the subtype constants
Returns
$this

◆ setWorkspace()

magic $this setWorkspace ( Workspace  $workspace)
Depends:
create-only, no getter
Returns
$this

◆ sortEnumOptions()

$this sortEnumOptions ( callable  $cmp)
Parameters
callable$cmpfn( EnumOption $a, EnumOption $b ): int
Returns
$this