<?php
/**
 * app/plugins/updates/forms.php
 *
 * This houses all of the form checking functions for this plugin.
 *
 * @package TP Status-Updates
 * @version 3.0
 * @author  Joey Kimsey <Joey@thetempusproject.com>
 * @link    https://TheTempusProject.com
 * @license https://opensource.org/licenses/MIT [MIT LICENSE]
 */
namespace TheTempusProject\Plugins\Updates;

use TheTempusProject\Bedrock\Functions\Input;
use TheTempusProject\Bedrock\Functions\Check;
use TheTempusProject\Classes\Forms;

class UpdateForms extends Forms {
    /**
     * Adds these functions to the form list.
     */
    public function __construct() {
        self::addHandler( 'createUpdate', __CLASS__, 'createUpdate' );
    }

    public static function createUpdate() {
        if ( ! Input::exists( 'status' ) ) {
            Check::addUserError( 'You must provide an status.' );
            return false;
        }
        return true;
    }
}

new UpdateForms;
