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/FormBuilderInterface.php

126 lines
3.6 KiB
PHP
Raw Normal View History

<?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>
*/
interface FormBuilderInterface extends \Traversable, \Countable, FormConfigBuilderInterface
{
/**
* 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.
*
* @param string|FormBuilderInterface $child
* @param string|FormTypeInterface $type
* @param array $options
*
* @return FormBuilderInterface The builder object.
*/
2012-07-09 13:50:58 +01:00
public function add($child, $type = null, array $options = array());
/**
* 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
*
* @return FormBuilderInterface The created builder.
*/
2012-07-09 13:50:58 +01:00
public function create($name, $type = null, array $options = array());
/**
* Returns a child by name.
*
* @param string $name The name of the child
*
* @return FormBuilderInterface The builder for the child
*
* @throws Exception\FormException if the given child does not exist
*/
2012-07-09 13:50:58 +01:00
public function get($name);
/**
* Removes the field with the given name.
*
* @param string $name
*
* @return FormBuilderInterface The builder object.
*/
2012-07-09 13:50:58 +01:00
public function remove($name);
/**
* Returns whether a field with the given name exists.
*
* @param string $name
*
* @return Boolean
*/
2012-07-09 13:50:58 +01:00
public function has($name);
/**
* Returns the children.
*
* @return array
*/
2012-07-09 13:50:58 +01:00
public function all();
2012-05-25 18:46:18 +01:00
/**
* Creates the form.
*
* @return Form The form
*/
2012-07-09 13:50:58 +01:00
public function getForm();
/**
* Sets the parent builder.
*
* @param FormBuilderInterface $parent The parent builder
*
* @return FormBuilderInterface The builder object.
*
* @deprecated Deprecated since version 2.2, to be removed in 2.3. You
* should not rely on the parent of a builder, because it is
* likely that the parent is only set after turning the builder
* into a form.
*/
2012-07-09 13:50:58 +01:00
public function setParent(FormBuilderInterface $parent = null);
/**
* Returns the parent builder.
*
* @return FormBuilderInterface The parent builder
*
* @deprecated Deprecated since version 2.2, to be removed in 2.3. You
* should not rely on the parent of a builder, because it is
* likely that the parent is only set after turning the builder
* into a form.
*/
2012-07-09 13:50:58 +01:00
public function getParent();
/**
* Returns whether the builder has a parent.
*
* @return Boolean
*
* @deprecated Deprecated since version 2.2, to be removed in 2.3. You
* should not rely on the parent of a builder, because it is
* likely that the parent is only set after turning the builder
* into a form.
*/
2012-07-09 13:50:58 +01:00
public function hasParent();
}