Changeset View
Changeset View
Standalone View
Standalone View
src/applications/metamta/query/PhabricatorMetaMTAMemberQuery.php
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | if ($package_phids) { | ||||
foreach ($package->getOwners() as $owner) { | foreach ($package->getOwners() as $owner) { | ||||
$owner_phid = $owner->getUserPHID(); | $owner_phid = $owner->getUserPHID(); | ||||
$owner_type = phid_get_type($owner_phid); | $owner_type = phid_get_type($owner_phid); | ||||
$type_map[$owner_type][] = $owner_phid; | $type_map[$owner_type][] = $owner_phid; | ||||
$package_owners[] = $owner_phid; | $package_owners[] = $owner_phid; | ||||
} | } | ||||
$package_map[$package->getPHID()] = $package_owners; | $package_map[$package->getPHID()] = $package_owners; | ||||
} | } | ||||
// See T13648. We may have packages that no longer exist or can't be | |||||
// loaded (for example, because they have been destroyed). Give them | |||||
// empty entries in the map so we return a mapping for all input PHIDs. | |||||
foreach ($package_phids as $package_phid) { | |||||
if (!isset($package_map[$package_phid])) { | |||||
$package_map[$package_phid] = array(); | |||||
} | |||||
} | |||||
} | } | ||||
$results = array(); | $results = array(); | ||||
foreach ($type_map as $type => $phids) { | foreach ($type_map as $type => $phids) { | ||||
switch ($type) { | switch ($type) { | ||||
case PhabricatorProjectProjectPHIDType::TYPECONST: | case PhabricatorProjectProjectPHIDType::TYPECONST: | ||||
// NOTE: We're loading the projects here in order to respect policies. | // NOTE: We're loading the projects here in order to respect policies. | ||||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |