Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102607073
PhabricatorPeopleAvailabilitySearchEngineAttachment.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Feb 22, 11:23
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Feb 24, 11:23 (2 d)
Engine
blob
Format
Raw Data
Handle
24376280
Attached To
rPH Phabricator
PhabricatorPeopleAvailabilitySearchEngineAttachment.php
View Options
<?php
final
class
PhabricatorPeopleAvailabilitySearchEngineAttachment
extends
PhabricatorSearchEngineAttachment
{
public
function
getAttachmentName
()
{
return
pht
(
'User Availability'
);
}
public
function
getAttachmentDescription
()
{
return
pht
(
'Get availability information for users.'
);
}
public
function
willLoadAttachmentData
(
$query
,
$spec
)
{
$query
->
needAvailability
(
true
);
}
public
function
getAttachmentForObject
(
$object
,
$data
,
$spec
)
{
$until
=
$object
->
getAwayUntil
();
if
(
$until
)
{
$until
=
(
int
)
$until
;
}
else
{
$until
=
null
;
}
$value
=
$object
->
getDisplayAvailability
();
if
(
$value
===
null
)
{
$value
=
PhabricatorCalendarEventInvitee
::
AVAILABILITY_AVAILABLE
;
}
$name
=
PhabricatorCalendarEventInvitee
::
getAvailabilityName
(
$value
);
$color
=
PhabricatorCalendarEventInvitee
::
getAvailabilityColor
(
$value
);
$event_phid
=
$object
->
getAvailabilityEventPHID
();
return
array
(
'value'
=>
$value
,
'until'
=>
$until
,
'name'
=>
$name
,
'color'
=>
$color
,
'eventPHID'
=>
$event_phid
,
);
}
}
Event Timeline
Log In to Comment