User
+ Inheritance diagram for User:

Description

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...
 
_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:
= [
'photo' => Photo::class,
'workspaces' => [Workspace::class]
]

Methods

◆ _getFavorites()

T [] _getFavorites ( string  $class,
Workspace  $workspace = null 
)
protected

@template T of AbstractEntity

Parameters
class-string<T>$class
null | Workspace$workspaceFalls back to the default workspace.
Returns
T[]

◆ addToWorkspace()

$this addToWorkspace ( Workspace  $workspace)
Parameters
Workspace$workspace
Returns
$this

◆ getEmail()

magic string getEmail ( )
Returns
string

◆ getFavoritePortfolios()

Portfolio [] getFavoritePortfolios ( Workspace  $workspace = null)
Parameters
null | Workspace$workspaceFalls back to the default workspace.
Returns
Portfolio[]

◆ getFavoriteProjects()

Project [] getFavoriteProjects ( Workspace  $workspace = null)
Parameters
null | Workspace$workspaceFalls back to the default workspace.
Returns
Project[]

◆ getFavoriteTags()

Tag [] getFavoriteTags ( Workspace  $workspace = null)
Parameters
null | Workspace$workspaceFalls back to the default workspace.
Returns
Tag[]

◆ getFavoriteTeams()

Team [] getFavoriteTeams ( Workspace  $workspace = null)
Parameters
null | Workspace$workspaceFalls back to the default workspace.
Returns
Team[]

◆ getFavoriteUsers()

User [] getFavoriteUsers ( Workspace  $workspace = null)
Parameters
null | Workspace$workspaceFalls back to the default workspace.
Returns
User[]

◆ getName()

magic string getName ( )
Returns
string

◆ getPhoto()

magic null Photo getPhoto ( )
Returns
null|Photo

◆ getPortfolios()

Portfolio [] getPortfolios ( Workspace  $workspace = null)
Parameters
null | Workspace$workspace
Returns
Portfolio[]

◆ getTaskList()

TaskList getTaskList ( Workspace  $workspace = null)
Parameters
null | Workspace$workspaceFalls back to the default workspace.
Returns
TaskList

◆ getTasks()

Task [] getTasks ( array  $filter = Task::GET_INCOMPLETE)

Returns all tasks in the given workspace that are assigned to the user.

Parameters
string[]$filterworkspace falls back to the default.
Returns
Task[]

◆ getTeams()

Team [] getTeams ( Workspace  $organization = null)

The user's teams.

See also
https://developers.asana.com/docs/get-teams-for-a-user
Parameters
null | Workspace$organizationFalls back to the default workspace.
Returns
Team[]

◆ getWorkspaces()

magic Workspace [] getWorkspaces ( )
Returns
Workspace[]

◆ removeFromWorkspace()

$this removeFromWorkspace ( Workspace  $workspace)
Parameters
Workspace$workspace
Returns
$this