Remove product literal strings in "pht()", part 18
[phabricator.git] / src / applications / people / engineextension / PhabricatorPeopleAvailabilitySearchEngineAttachment.php
blobf61ebe7f01bbe24a8e291ec8400abc66f46421ae
1 <?php
3 final class PhabricatorPeopleAvailabilitySearchEngineAttachment
4 extends PhabricatorSearchEngineAttachment {
6 public function getAttachmentName() {
7 return pht('User Availability');
10 public function getAttachmentDescription() {
11 return pht('Get availability information for users.');
14 public function willLoadAttachmentData($query, $spec) {
15 $query->needAvailability(true);
18 public function getAttachmentForObject($object, $data, $spec) {
20 $until = $object->getAwayUntil();
21 if ($until) {
22 $until = (int)$until;
23 } else {
24 $until = null;
27 $value = $object->getDisplayAvailability();
28 if ($value === null) {
29 $value = PhabricatorCalendarEventInvitee::AVAILABILITY_AVAILABLE;
32 $name = PhabricatorCalendarEventInvitee::getAvailabilityName($value);
33 $color = PhabricatorCalendarEventInvitee::getAvailabilityColor($value);
35 $event_phid = $object->getAvailabilityEventPHID();
37 return array(
38 'value' => $value,
39 'until' => $until,
40 'name' => $name,
41 'color' => $color,
42 'eventPHID' => $event_phid,