<?php
/**
 * Event triggered after HTML for Form / E-mail is renderered
 * allows modifying the rendered HTML
 *
 * Use VisualM\FormBundle\Helper\Event\FormEvents::AFTER_POPULATE_BUILDER
 * to attach a listener
 *
 * @author Elze Kool <info@visualmedia.nl>
 */

namespace VisualM\FormBundle\Helper\Event;

use Symfony\Component\EventDispatcher\Event;
use VisualM\FormBundle\Entity\Form as FormEntity;

/**
 * Event triggered after HTML for Form / E-mail is renderered
 * allows modifying the rendered HTML
 *
 * Use VisualM\FormBundle\Helper\Event\FormEvents::AFTER_HTML_RENDER
 * to attach a listener
 *
 * @author Elze Kool <info@visualmedia.nl>
 */
class AfterHtmlRenderEvent extends Event
{

    /**
     * HTML is for Form
     * @var string
     */
    const TYPE_FORM = 'form';

    /**
     * HTML is for E-mail
     * @var string
     */
    const TYPE_EMAIL = 'email';

    /**
     * HTML is for Kopie E-mail
     * @var string
     */
    const TYPE_KOPIE_EMAIL = 'kopie_email';

    /**
     * Form
     * @var FormEntity
     */
    protected $form;

    /**
     * HTML
     * @var string
     */
    protected $html;

    /**
     * Type
     * @var string
     */
    protected $type;

    /**
     * Constructor
     *
     * @param FormEntity $form Form
     * @param string     $html Html
     * @param string     $type Type
     */
    public function __construct(FormEntity $form, $html, $type)
    {
        $this->form = $form;
        $this->html = $html;
        $this->type = $type;
    }

    /**
     * Get Form
     *
     * @return FormEntity
     */
    public function getForm()
    {
        return $this->form;
    }

    /**
     * Get Html
     *
     * @return string Html
     **/
    public function getHtml()
    {
        return $this->html;
    }

    /**
     * Set Html
     *
     * @param string $html Html
     **/
    public function setHtml($html)
    {
        $this->html = $html;
    }

    /**
     * Get Type
     *
     * Returns AfterHtmlRenderEvent::TYPE_ constant
     *
     * @return string
     */
    public function getType()
    {
        return $this->type;
    }


}