A task.
Public Properties | |
final const | ASSIGN_INBOX = 'inbox' |
final const | ASSIGN_LATER = 'later' |
final const | ASSIGN_NEW = 'new' |
final const | ASSIGN_TODAY = 'today' |
final const | ASSIGN_UPCOMING = 'upcoming' |
final const | GET_INCOMPLETE = ['completed_since' => 'now'] |
final const | TYPE = 'task' |
Public Properties inherited from AbstractEntity | |
const | TYPE = '' |
All entity classes must redeclare this to match their resource_type . More... | |
Protected Properties | |
final const | DIR = 'tasks' |
const | MAP |
const | OPT_FIELDS |
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 | |
Attachment | addAttachment (string $file) |
Uploads a file attachment. More... | |
$this | addDependencies (array $tasks) |
Premium feature. More... | |
$this | addDependency (Task $task) |
Premium feature. More... | |
$this | addDependent (Task $task) |
Premium feature. More... | |
$this | addDependents (array $tasks) |
Premium feature. More... | |
$this | addTag (Tag $tag) |
Adds a tag. More... | |
$this | addToProject ($target) |
Adds the task to a project. More... | |
$this | addToProjects (iterable $targets) |
Adds the task to multiple projects. More... | |
$this | create () |
Job | duplicate (string $name, array $include) |
Duplicates the task. More... | |
$this | follow () |
Adds the API user as a follower. More... | |
magic null User | getAssignee () |
magic string | getAssigneeStatus () |
Attachment[] | getAttachments () |
Attached files. More... | |
Story[] | getComments () |
magic string | getCompletedAt () |
RFC3339x. More... | |
magic string | getCreatedAt () |
RFC3339x. More... | |
magic null FieldEntries | getCustomFields () |
Premium feature. More... | |
Task[] | getDependencies () |
Premium feature. More... | |
Task[] | getDependents () |
Premium feature. More... | |
ExternalData | getExternal () |
A proxy to the task's "external data". More... | |
magic bool | getIsRenderedAsSeparator () |
magic Membership[] | getMemberships () |
magic string | getModifiedAt () |
RFC3339x. More... | |
magic string | getName () |
magic string | getNotes () |
magic int | getNumSubtasks () |
magic null Task | getParent () |
Project[] | getProjects () |
magic string | getResourceSubtype () |
Section[] | getSections () |
Story[] | getStories () |
Task[] | getSubTasks () |
magic Tag[] | getTags () |
TaskWebhook[] | getWebhooks () |
magic Workspace | getWorkspace () |
magic bool | hasAssignee () |
magic bool | hasCustomFields () |
Premium feature. More... | |
magic bool | hasMemberships () |
magic bool | hasName () |
magic bool | hasNotes () |
magic bool | hasParent () |
magic bool | hasTags () |
magic bool | isCompleted () |
Story | newComment () |
Factory. More... | |
Task | newSubTask () |
Factory. More... | |
TaskWebhook | newWebhook () |
Factory. More... | |
magic bool | ofMilestone () |
$this | removeDependencies (array $tasks) |
Premium feature. More... | |
$this | removeDependency (Task $task) |
Premium feature. More... | |
$this | removeDependent (Task $task) |
Premium feature. More... | |
$this | removeDependents (array $tasks) |
Premium feature. More... | |
$this | removeFromProject (Project $project) |
Removes the task from a project. More... | |
$this | removeFromProjects (iterable $projects) |
Removes the task from multiple projects. More... | |
$this | removeTag (Tag $tag) |
Removes a tag. More... | |
magic Attachment[] | selectAttachments (callable $filter) |
fn( Attachment $attachment): bool More... | |
magic Story[] | selectComments (callable $filter) |
fn( Story $comment ): bool More... | |
magic Task[] | selectDependencies (callable $filter) |
fn( Task $dependency ): bool More... | |
magic Task[] | selectDependents (callable $filter) |
fn( Task $dependent ): bool More... | |
magic Membership[] | selectMemberships (callable $filter) |
fn( Membership $membership ): bool More... | |
magic Project[] | selectProjects (callable $filter) |
fn( Project $project ): bool More... | |
magic Story[] | selectStories (callable $filter) |
fn( Story $story ): bool More... | |
magic Task[] | selectSubTasks (callable $filter) |
fn( Task $subtask ): bool More... | |
magic Tag[] | selectTags (callable $filter) |
fn( Tag $tag ): bool More... | |
magic $this | setAssignee (?User $user) |
magic $this | setAssigneeStatus (string $status) |
magic $this | setCompleted (bool $completed) |
magic $this | setIsRenderedAsSeparator (bool $flag) |
magic $this | setName (string $name) |
magic $this | setNotes (string $notes) |
$this | setParent (?Task $parent) |
Makes the task a subtask of another. More... | |
magic $this | setResourceSubtype (string $type) |
magic $this | setWorkspace (Workspace $workspace) |
$this | unfollow () |
Removes the API user as a follower. More... | |
$this | update () |
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 DeleteTrait | |
void | delete () |
Deletes the entity from Asana. More... | |
Public Methods inherited from DateTimeTrait | |
null DateTimeInterface | _getDateTime () |
Returns a date-time field as an immutable object. More... | |
Public Methods inherited from DueTrait | |
magic null string | getDueOn () |
Y-m-d More... | |
magic null string | getStartOn () |
Y-m-d More... | |
magic bool | hasDueOn () |
magic bool | hasStartOn () |
$this | setDueOn ($date) |
$this | setStartOn ($date) |
Public Methods inherited from FollowersTrait | |
$this | addFollower (User $user) |
$this | addFollowers (array $users) |
magic User[] | getFollowers () |
magic bool | hasFollowers () |
$this | removeFollower (User $user) |
$this | removeFollowers (array $users) |
magic User[] | selectFollowers (callable $filter) |
fn( User $user ): bool More... | |
Public Methods inherited from LikesTrait | |
magic Like[] | getLikes () |
magic int | getNumLikes () |
magic bool | hasLikes () |
magic bool | isLiked () |
Whether you like this. More... | |
magic Like[] | selectLikes (callable $filter) |
fn( Like $like ): bool More... | |
magic $this | setLiked (bool $liked) |
Sets whether you like this. More... | |
Public Methods inherited from SyncTrait | |
Event[] | getEvents (?string &$token) |
Polls for new events. More... | |
Public Methods inherited from UrlTrait | |
string | getUrl () |
Protected Methods | |
null | _getParentNode () |
void | _setData (array $data) |
Protected Methods inherited from AbstractEntity | |
mixed | _get (string $field) |
Lazy-loads missing fields. More... | |
void | _reload (string $field) |
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 |
|
protected |
|
finalprotected |
Reimplemented from CreateTrait.
|
protected |
Attachment addAttachment | ( | string | $file | ) |
$this addToProject | ( | $target | ) |
Adds the task to a project.
Project | Section | $target |
$this addToProjects | ( | iterable | $targets | ) |
$this create | ( | ) |
Reimplemented from CreateTrait.
Job duplicate | ( | string | $name, |
array | $include | ||
) |
$this follow | ( | ) |
Adds the API user as a follower.
magic null User getAssignee | ( | ) |
magic string getAssigneeStatus | ( | ) |
Attachment [] getAttachments | ( | ) |
Attached files.
magic string getCompletedAt | ( | ) |
RFC3339x.
magic string getCreatedAt | ( | ) |
RFC3339x.
magic null FieldEntries getCustomFields | ( | ) |
Premium feature.
ExternalData getExternal | ( | ) |
A proxy to the task's "external data".
This always returns an instance, regardless of whether the task on Asana actually has external data.
Asana will delete the external data object if it's emptied, and fetching it via
GET
will then returnnull
, so we coalesce.
magic bool getIsRenderedAsSeparator | ( | ) |
magic Membership [] getMemberships | ( | ) |
magic string getModifiedAt | ( | ) |
RFC3339x.
magic string getName | ( | ) |
magic string getNotes | ( | ) |
magic int getNumSubtasks | ( | ) |
magic null Task getParent | ( | ) |
magic string getResourceSubtype | ( | ) |
Section [] getSections | ( | ) |
TaskWebhook [] getWebhooks | ( | ) |
magic bool hasAssignee | ( | ) |
magic bool hasCustomFields | ( | ) |
Premium feature.
magic bool hasMemberships | ( | ) |
magic bool hasName | ( | ) |
magic bool hasNotes | ( | ) |
magic bool hasParent | ( | ) |
magic bool hasTags | ( | ) |
magic bool isCompleted | ( | ) |
TaskWebhook newWebhook | ( | ) |
Factory.
magic bool ofMilestone | ( | ) |
$this removeFromProject | ( | Project | $project | ) |
$this removeFromProjects | ( | iterable | $projects | ) |
magic Attachment [] selectAttachments | ( | callable | $filter | ) |
fn( Attachment $attachment): bool
magic Membership [] selectMemberships | ( | callable | $filter | ) |
fn( Membership $membership ): bool
magic $this setAssigneeStatus | ( | string | $status | ) |
magic $this setCompleted | ( | bool | $completed | ) |
magic $this setIsRenderedAsSeparator | ( | bool | $flag | ) |
magic $this setName | ( | string | $name | ) |
magic $this setNotes | ( | string | $notes | ) |
|
final |
$this unfollow | ( | ) |
Removes the API user as a follower.
$this update | ( | ) |
Reimplemented from UpdateTrait.