2012-05-23 18:34:41 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of the Symfony package.
|
|
|
|
*
|
|
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Symfony\Component\Form;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Bernhard Schussek <bschussek@gmail.com>
|
|
|
|
*/
|
2012-07-28 09:59:23 +01:00
|
|
|
interface FormBuilderInterface extends \Traversable, \Countable, FormConfigBuilderInterface
|
2012-05-23 18:34:41 +01:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Adds a new field to this group. A field must have a unique name within
|
|
|
|
* the group. Otherwise the existing field is overwritten.
|
|
|
|
*
|
|
|
|
* If you add a nested group, this group should also be represented in the
|
|
|
|
* object hierarchy.
|
|
|
|
*
|
2014-07-09 11:03:33 +01:00
|
|
|
* @param string|int|FormBuilderInterface $child
|
|
|
|
* @param string|FormTypeInterface $type
|
|
|
|
* @param array $options
|
2012-05-23 18:34:41 +01:00
|
|
|
*
|
2017-06-08 08:18:54 +01:00
|
|
|
* @return self
|
2012-05-23 18:34:41 +01:00
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function add($child, $type = null, array $options = array());
|
2012-05-23 18:34:41 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a form builder.
|
|
|
|
*
|
|
|
|
* @param string $name The name of the form or the name of the property
|
|
|
|
* @param string|FormTypeInterface $type The type of the form or null if name is a property
|
|
|
|
* @param array $options The options
|
|
|
|
*
|
2016-12-26 07:50:27 +00:00
|
|
|
* @return self
|
2012-05-23 18:34:41 +01:00
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function create($name, $type = null, array $options = array());
|
2012-05-23 18:34:41 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a child by name.
|
|
|
|
*
|
|
|
|
* @param string $name The name of the child
|
|
|
|
*
|
2016-12-26 07:50:27 +00:00
|
|
|
* @return self
|
2012-05-23 18:34:41 +01:00
|
|
|
*
|
2013-04-15 21:11:02 +01:00
|
|
|
* @throws Exception\InvalidArgumentException if the given child does not exist
|
2012-05-23 18:34:41 +01:00
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function get($name);
|
2012-12-14 15:05:05 +00:00
|
|
|
|
2012-05-23 18:34:41 +01:00
|
|
|
/**
|
|
|
|
* Removes the field with the given name.
|
|
|
|
*
|
|
|
|
* @param string $name
|
|
|
|
*
|
2017-06-08 08:18:54 +01:00
|
|
|
* @return self
|
2012-05-23 18:34:41 +01:00
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function remove($name);
|
2012-05-23 18:34:41 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether a field with the given name exists.
|
|
|
|
*
|
|
|
|
* @param string $name
|
|
|
|
*
|
2014-04-16 11:30:19 +01:00
|
|
|
* @return bool
|
2012-05-23 18:34:41 +01:00
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function has($name);
|
2012-05-23 18:34:41 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the children.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function all();
|
2012-05-25 18:46:18 +01:00
|
|
|
|
2012-05-23 18:34:41 +01:00
|
|
|
/**
|
|
|
|
* Creates the form.
|
|
|
|
*
|
2016-06-17 12:17:04 +01:00
|
|
|
* @return FormInterface The form
|
2012-05-23 18:34:41 +01:00
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function getForm();
|
2012-05-23 18:34:41 +01:00
|
|
|
}
|