Differential D17719 Diff 42618 src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php
| Show All 31 Lines | public function execute(PhutilArgumentParser $args) { | ||||
| $ids = $args->getArg('id'); | $ids = $args->getArg('id'); | ||||
| if (!$ids) { | if (!$ids) { | ||||
| throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
| pht( | pht( | ||||
| "Use the '%s' flag to specify one or more messages to show.", | "Use the '%s' flag to specify one or more messages to show.", | ||||
| '--id')); | '--id')); | ||||
| } | } | ||||
| foreach ($ids as $id) { | |||||
| if (!ctype_digit($id)) { | |||||
| throw new PhutilArgumentUsageException( | |||||
| pht( | |||||
| 'Argument "%s" is not a valid message ID.', | |||||
| $id)); | |||||
| } | |||||
| } | |||||
| $messages = id(new PhabricatorMetaMTAMail())->loadAllWhere( | $messages = id(new PhabricatorMetaMTAMail())->loadAllWhere( | ||||
| 'id IN (%Ld)', | 'id IN (%Ld)', | ||||
| $ids); | $ids); | ||||
| if ($ids) { | if ($ids) { | ||||
| $ids = array_fuse($ids); | $ids = array_fuse($ids); | ||||
| $missing = array_diff_key($ids, $messages); | $missing = array_diff_key($ids, $messages); | ||||
| if ($missing) { | if ($missing) { | ||||
| ▲ Show 20 Lines • Show All 133 Lines • Show Last 20 Lines | |||||