This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Form/FormInterface.php

132 lines
2.6 KiB
PHP
Raw Normal View History

<?php
2010-10-02 11:38:11 +01:00
/*
* This file is part of the Symfony package.
2010-10-02 11:38:11 +01:00
*
* (c) Fabien Potencier <fabien@symfony.com>
2010-10-02 11:38:11 +01:00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
2010-10-02 11:38:11 +01:00
*/
namespace Symfony\Component\Form;
/**
* A form group bundling multiple form forms
*
* @author Bernhard Schussek <bernhard.schussek@symfony.com>
*/
interface FormInterface extends \ArrayAccess, \Traversable, \Countable
{
/**
* Sets the parent form.
*
* @param FormInterface $parent The parent form
*/
function setParent(FormInterface $parent = null);
/**
* Returns the parent form.
*
* @return FormInterface The parent form
*/
function getParent();
function add(FormInterface $child);
function has($name);
function remove($name);
function getChildren();
function hasChildren();
2011-03-22 22:20:14 +00:00
function hasParent();
function getErrors();
function setData($data);
2011-03-22 22:20:14 +00:00
function getData();
function getNormData();
2011-03-22 22:20:14 +00:00
function getClientData();
function isBound();
function getTypes();
/**
* Returns the name by which the form is identified in forms.
*
* @return string The name of the form.
*/
function getName();
/**
* Adds an error to this form
*
* @param FormError $error
*/
function addError(FormError $error);
/**
* Returns whether the form is valid.
*
* @return Boolean
*/
function isValid();
/**
* Returns whether the form is required to be filled out.
*
* If the form has a parent and the parent is not required, this method
* will always return false. Otherwise the value set with setRequired()
* is returned.
*
* @return Boolean
*/
function isRequired();
/**
* Returns whether this form can be read only
*
* The content of a read-only form is displayed, but not allowed to be
* modified. The validation of modified read-only forms should fail.
*
* Fields whose parents are read-only are considered read-only regardless of
* their own state.
*
* @return Boolean
*/
function isReadOnly();
/**
* Returns whether the form is empty
*
2011-04-27 06:25:26 +01:00
* @return Boolean
*/
function isEmpty();
function isSynchronized();
/**
* Writes posted data into the form
*
* @param mixed $data The data from the POST request
*/
function bind($data);
function hasAttribute($name);
function getAttribute($name);
function getRoot();
function isRoot();
function createView(FormView $parent = null);
}