<?php
/**
 * Generated Form Data
 *
 * Storage for data submitted with GeneratedFormType
 *
 * @author Elze Kool <info@visualmedia.nl>
 */

namespace VisualM\FormBundle\Form\Data;

/**
 * Generated Form Data
 *
 * Storage for data submitted with GeneratedFormType
 *
 * @author Elze Kool <info@visualmedia.nl>
 */
class GeneratedFormData
{

    private $data = [];

    /**
     * Get all data
     *
     * @return array All data
     */
    public function all()
    {
        return $this->data;
    }

    /**
     * Get all data
     *
     * @param string $field Field
     *
     * @return string|null Data for field
     */
    public function get($field)
    {
        return isset($this->data[$field]) ? $this->data[$field] : null;
    }

    /**
     * Set data
     *
     * @param string $field Field
     * @param string $value Value
     */
    public function set($field, $value)
    {
        $this->data[$field] = $value;
    }
    
}