<?php

/**
 * This file defines the disposition class
 *
 * @package CGProductBuilder
 * @category Utilities
 * @author  calguy1000 <calguy1000@cmsmadesimple.org>
 * @copyright Copyright 2010 by Robert Campbell
 */

namespace CGProductBuilder;

/**
 * An abstract class to define a disposition.
 */
abstract class disposition
{
    /**
     * Get the friendly name for this disposition.
     *
     * @abstract
     * @return string
     */
    abstract public function get_friendlyname();

    /**
     * Get the button text for this disposition.
     * The button text is used on the final summary view of the product builder so that the customer can select a disposition.
     *
     * @return string
     */
    abstract public function get_buttontext();

    /**
     * Test if this disposition is compatible with the current install of CMSMS.
     * Typically this would check if certain modules are installed and properly configured.
     *
     * @abstract
     * @return bool
     */
    public function compatible() { return TRUE; }

    /**
     * Test if this disposition is ready to be used to disposing a form.
     * Normally this involves checking if email sending is properly setup, or the user is logged in to FEU etc.
     *
     * @abstract
     * @return bool
     */
    public function ready() { return TRUE; }

    /**
     * Dispose (handle) the product specification.
     *
     * @param \CGProductBuilder\ProductSpec $productSpec
     * @return string Optional text to display after disposing of the form.
     */
    abstract public function dispose(ProductSpec $productSpec);
} // end of class

?>
