private function applyCommands(NuanceItem $item) { $viewer = $this->getViewer(); $impl = $item->getImplementation(); $impl->setViewer($viewer); $commands = id(new NuanceItemCommandQuery())->setViewer($viewer)->withItemPHIDs(array($item->getPHID()))->execute(); $commands = msort($commands, 'getID'); foreach ($commands as $command) { $impl->applyCommand($item, $command); $command->delete(); } }
private function buildCommands(NuanceItem $item) { $viewer = $this->getViewer(); $commands = id(new NuanceItemCommandQuery())->setViewer($viewer)->withItemPHIDs(array($item->getPHID()))->execute(); $commands = msort($commands, 'getID'); if (!$commands) { return null; } $rows = array(); foreach ($commands as $command) { $rows[] = array($command->getCommand()); } $table = id(new AphrontTableView($rows))->setHeaders(array(pht('Command'))); return id(new PHUIObjectBoxView())->setHeaderText(pht('Pending Commands'))->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)->setTable($table); }
protected final function newContentSource(NuanceItem $item, $agent_phid) { return PhabricatorContentSource::newForSource(NuanceContentSource::SOURCECONST, array('itemPHID' => $item->getPHID(), 'agentPHID' => $agent_phid)); }