A user.
Public Properties | |
final const | TYPE = 'user' |
Public Properties inherited from AbstractEntity | |
const | TYPE = '' |
All entity classes must redeclare this to match their resource_type . More... | |
Protected Properties | |
final const | DIR = 'users' |
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 | |
$this | addToWorkspace (Workspace $workspace) |
magic string | getEmail () |
Portfolio[] | getFavoritePortfolios (Workspace $workspace=null) |
Project[] | getFavoriteProjects (Workspace $workspace=null) |
Tag[] | getFavoriteTags (Workspace $workspace=null) |
Team[] | getFavoriteTeams (Workspace $workspace=null) |
User[] | getFavoriteUsers (Workspace $workspace=null) |
magic string | getName () |
magic null Photo | getPhoto () |
Portfolio[] | getPortfolios (Workspace $workspace=null) |
TaskList | getTaskList (Workspace $workspace=null) |
Task[] | getTasks (array $filter=Task::GET_INCOMPLETE) |
Returns all tasks in the given workspace that are assigned to the user. More... | |
Team[] | getTeams (Workspace $organization=null) |
The user's teams. More... | |
magic Workspace[] | getWorkspaces () |
$this | removeFromWorkspace (Workspace $workspace) |
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... | |
Protected Methods | |
T[] | _getFavorites (string $class, Workspace $workspace=null) |
@template T of AbstractEntity More... | |
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 |
|
protected |
@template T of AbstractEntity
class-string<T> | $class | |
null | Workspace | $workspace | Falls back to the default workspace. |
magic string getEmail | ( | ) |
magic string getName | ( | ) |
magic null Photo getPhoto | ( | ) |
Task [] getTasks | ( | array | $filter = Task::GET_INCOMPLETE | ) |
Returns all tasks in the given workspace that are assigned to the user.
string[] | $filter | workspace falls back to the default. |