A custom field.
See FieldEntries for getting Task values.
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... | |
T | _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... | |
|
protected |
|
finalprotected |
Reimplemented from CreateTrait.
magic null string getCurrencyCode | ( | ) |
ISO 4217.
magic null string getCustomLabel | ( | ) |
null
unless format
is custom
magic string getCustomLabelPosition | ( | ) |
See the position constants.
magic string getDescription | ( | ) |
null EnumOption getEnumOption | ( | string | $ident | ) |
string | $ident | GID or name. |
magic EnumOption [] getEnumOptions | ( | ) |
magic string getFormat | ( | ) |
See the format constants.
magic string getName | ( | ) |
magic int getPrecision | ( | ) |
magic string getResourceSubtype | ( | ) |
|
final |
|
final |
magic bool isEnabled | ( | ) |
|
final |
|
final |
|
final |
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
magic $this setCurrencyCode | ( | string | $iso4217 | ) |
Requires subtype=number
, format=currency
magic $this setCustomLabel | ( | string | $label | ) |
Requires format=custom
magic $this setCustomLabelPosition | ( | string | $position | ) |
See the position constants.
magic $this setDescription | ( | string | $text | ) |
magic $this setFormat | ( | string | $format | ) |
See the format constants.
|
final |
bool | $global |
magic $this setName | ( | string | $name | ) |
|
final |
bool | $enabled |
magic $this setPrecision | ( | int | $precision | ) |
magic $this setResourceSubtype | ( | string | $type | ) |
$this sortEnumOptions | ( | callable | $cmp | ) |
callable | $cmp | fn( EnumOption $a, EnumOption $b ): int |