getPHID(); if ($object_phid) { $project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( $object_phid, $project_edge_type); $project_phids = array_reverse($project_phids); } else { $project_phids = array(); } $projects_field = id(new PhabricatorProjectsEditField()) ->setKey('projectPHIDs') ->setLabel(pht('Projects')) ->setEditTypeKey('projects') ->setDescription(pht('Add or remove associated projects.')) ->setAliases(array('project', 'projects')) ->setUseEdgeTransactions(true) ->setEdgeTransactionDescriptions( pht('Add projects.'), pht('Remove projects.'), pht('Set associated projects, overwriting current value.')) ->setTransactionType($edge_type) ->setMetadataValue('edge:type', $project_edge_type) ->setValue($project_phids); return array( $projects_field, ); } }