<?php
/**
 * Event called after populating the form builder
 * allows modifing the form just before it is about to be
 * rendered
 *
 * 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 Symfony\Component\Form\FormBuilderInterface;
use VisualM\FormBundle\Entity\Form as FormEntity;

/**
 * Event called after populating the form builder
 * allows modifing the form just before it is about to be
 * rendered
 *
 * Use VisualM\FormBundle\Helper\Event\FormEvents::AFTER_POPULATE_BUILDER
 * to attach a listener
 *
 * @author Elze Kool <info@visualmedia.nl>
 */
class AfterPopulateBuilderEvent extends Event
{
    /**
     * Form Builder
     * @var FormBuilderInterface
     */
    protected $formBuilder;

    /**
     * Form Entity
     * @var FormEntity
     */
    protected $formEntity;

    /**
     * Constructor
     *
     * @param FormBuilderInterface $formBuilder Form Builder
     * @param FormEntity           $formEntity  Form Entity
     */
    public function __construct(FormBuilderInterface $formBuilder, FormEntity $formEntity)
    {
        $this->formBuilder = $formBuilder;
        $this->formEntity = $formEntity;
    }

    /**
     * Get Form Builder
     *
     * @return FormBuilder
     */
    public function getFormBuilder()
    {
        return $this->formBuilder;
    }

    /**
     * Get Form Entity
     *
     * @return FormEntity
     */
    public function getFormEntity()
    {
        return $this->formEntity;
    }



}