2011-03-02 13:58:19 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of the Symfony package.
|
|
|
|
*
|
2011-04-22 16:41:21 +01:00
|
|
|
* (c) Fabien Potencier <fabien@symfony.com>
|
2011-03-02 13:58:19 +00:00
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
2011-04-22 16:41:21 +01:00
|
|
|
namespace Symfony\Component\Form;
|
2011-03-02 13:58:19 +00:00
|
|
|
|
2011-05-10 17:23:58 +01:00
|
|
|
/**
|
|
|
|
* Interface for extensions which provide types, type extensions and a guesser.
|
|
|
|
*/
|
2011-04-22 16:41:21 +01:00
|
|
|
interface FormExtensionInterface
|
2011-03-02 13:58:19 +00:00
|
|
|
{
|
2011-05-10 17:23:58 +01:00
|
|
|
/**
|
|
|
|
* Returns a type by name.
|
|
|
|
*
|
|
|
|
* @param string $name The name of the type
|
|
|
|
*
|
|
|
|
* @return FormTypeInterface The type
|
2012-05-21 03:26:59 +01:00
|
|
|
*
|
2013-04-15 21:11:02 +01:00
|
|
|
* @throws Exception\InvalidArgumentException if the given type is not supported by this extension
|
2011-05-10 17:23:58 +01:00
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function getType($name);
|
2011-03-02 13:58:19 +00:00
|
|
|
|
2011-05-10 17:23:58 +01:00
|
|
|
/**
|
|
|
|
* Returns whether the given type is supported.
|
|
|
|
*
|
|
|
|
* @param string $name The name of the type
|
|
|
|
*
|
2014-07-09 11:03:33 +01:00
|
|
|
* @return bool Whether the type is supported by this extension
|
2011-05-10 17:23:58 +01:00
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function hasType($name);
|
2011-04-22 16:41:21 +01:00
|
|
|
|
2011-05-10 17:23:58 +01:00
|
|
|
/**
|
|
|
|
* Returns the extensions for the given type.
|
|
|
|
*
|
|
|
|
* @param string $name The name of the type
|
|
|
|
*
|
2012-11-01 15:08:59 +00:00
|
|
|
* @return FormTypeExtensionInterface[] An array of extensions as FormTypeExtensionInterface instances
|
2011-05-10 17:23:58 +01:00
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function getTypeExtensions($name);
|
2011-04-22 18:22:26 +01:00
|
|
|
|
2011-05-10 17:23:58 +01:00
|
|
|
/**
|
|
|
|
* Returns whether this extension provides type extensions for the given type.
|
|
|
|
*
|
|
|
|
* @param string $name The name of the type
|
|
|
|
*
|
2014-07-09 11:03:33 +01:00
|
|
|
* @return bool Whether the given type has extensions
|
2011-05-10 17:23:58 +01:00
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function hasTypeExtensions($name);
|
2011-04-22 18:22:26 +01:00
|
|
|
|
2011-05-10 17:23:58 +01:00
|
|
|
/**
|
|
|
|
* Returns the type guesser provided by this extension.
|
|
|
|
*
|
|
|
|
* @return FormTypeGuesserInterface|null The type guesser
|
|
|
|
*/
|
2012-07-09 13:50:58 +01:00
|
|
|
public function getTypeGuesser();
|
2011-04-22 16:41:21 +01:00
|
|
|
}
|