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

64 lines
1.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;
2011-05-10 17:23:58 +01:00
/**
* Interface for extensions which provide types, type extensions and a guesser.
*/
interface FormExtensionInterface
{
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
*
* @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-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-05-10 17:23:58 +01:00
/**
* Returns the extensions for the given type.
*
* @param string $name The name of the type
*
* @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-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-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();
}