Changeset View
Changeset View
Standalone View
Standalone View
src/applications/nuance/command/NuanceTrashCommand.php
| <?php | <?php | ||||
| final class NuanceTrashCommand | final class NuanceTrashCommand | ||||
| extends NuanceCommandImplementation { | extends NuanceCommandImplementation { | ||||
| const COMMANDKEY = 'trash'; | const COMMANDKEY = 'trash'; | ||||
| public function getCommandName() { | public function getCommandName() { | ||||
| return pht('Throw in Trash'); | return pht('Throw in Trash'); | ||||
| } | } | ||||
| public function canApplyToItem(NuanceItem $item) { | public function canApplyToItem(NuanceItem $item) { | ||||
| $type = $item->getImplementation(); | $type = $item->getImplementation(); | ||||
| return ($type instanceof NuanceFormItemType); | return ($type instanceof NuanceFormItemType); | ||||
| } | } | ||||
| public function canApplyImmediately( | |||||
| NuanceItem $item, | |||||
| NuanceItemCommand $command) { | |||||
| return true; | |||||
| } | |||||
| protected function executeCommand( | protected function executeCommand( | ||||
| NuanceItem $item, | NuanceItem $item, | ||||
| NuanceItemCommand $command) { | NuanceItemCommand $command) { | ||||
| $this->newStatusTransaction(NuanceItem::STATUS_CLOSED); | $this->newStatusTransaction(NuanceItem::STATUS_CLOSED); | ||||
| } | } | ||||
| } | } | ||||