Changeset View
Changeset View
Standalone View
Standalone View
src/applications/calendar/storage/PhabricatorCalendarEvent.php
Show First 20 Lines • Show All 485 Lines • ▼ Show 20 Lines | final class PhabricatorCalendarEvent extends PhabricatorCalendarDAO | ||||
} | } | ||||
private function newStubInvitees() { | private function newStubInvitees() { | ||||
$parent = $this->getParentEvent(); | $parent = $this->getParentEvent(); | ||||
$parent_invitees = $parent->getInvitees(); | $parent_invitees = $parent->getInvitees(); | ||||
$stub_invitees = array(); | $stub_invitees = array(); | ||||
// All stubs should inherit the host's status | |||||
foreach ($parent_invitees as $invitee) { | foreach ($parent_invitees as $invitee) { | ||||
$host_phid = $parent->getHostPHID(); | |||||
$inviter_phid = $invitee->getInviterPHID(); | |||||
$invitee_phid = $invitee->getInviteePHID(); | |||||
if ($host_phid === $invitee_phid) { | |||||
$status = $invitee->getStatus(); | |||||
} else { | |||||
$status = PhabricatorCalendarEventInvitee::STATUS_INVITED; | |||||
} | |||||
$stub_invitee = id(new PhabricatorCalendarEventInvitee()) | $stub_invitee = id(new PhabricatorCalendarEventInvitee()) | ||||
->setInviteePHID($invitee->getInviteePHID()) | ->setInviteePHID($inviter_phid) | ||||
->setInviterPHID($invitee->getInviterPHID()) | ->setInviterPHID($invitee_phid) | ||||
->setStatus(PhabricatorCalendarEventInvitee::STATUS_INVITED); | ->setStatus($status); | ||||
$stub_invitees[] = $stub_invitee; | $stub_invitees[] = $stub_invitee; | ||||
} | } | ||||
return $stub_invitees; | return $stub_invitees; | ||||
} | } | ||||
public function attachInvitees(array $invitees) { | public function attachInvitees(array $invitees) { | ||||
▲ Show 20 Lines • Show All 953 Lines • Show Last 20 Lines |