AppStateESS/homestead

View on GitHub
class/Command/SaveTermSettingsCommand.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Homestead\Command;

use \Homestead\Term;
use \Homestead\CommandFactory;

class SaveTermSettingsCommand extends Command {

    public function getRequestVars()
    {
        return array('action'=>'SaveTermSettings');
    }

    public function execute(CommandContext $context)
    {
        $term = new Term(Term::getSelectedTerm());

        $term->setDocusignTemplate($context->get('template'));
        $term->setDocusignUnder18Template($context->get('under18_template'));

        $term->save();

        $cmd = CommandFactory::getCommand('ShowEditTerm');
        $cmd->redirect();
    }
}