[Form] Added getBlockPrefix() to ResolvedFormTypeInterface

This commit is contained in:
Bernhard Schussek 2015-11-29 22:12:04 +01:00
parent ab2044f6d8
commit 7e89345a0d
3 changed files with 9 additions and 12 deletions

View File

@ -43,20 +43,12 @@ class ResolvedTypeDataCollectorProxy implements ResolvedFormTypeInterface
$this->dataCollector = $dataCollector; $this->dataCollector = $dataCollector;
} }
/**
* {@inheritdoc}
*/
public function getName()
{
return $this->proxiedType->getName();
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getBlockPrefix() public function getBlockPrefix()
{ {
return method_exists($this->proxiedType, 'getBlockPrefix') ? $this->proxiedType->getBlockPrefix() : $this->getName(); return $this->proxiedType->getBlockPrefix();
} }
/** /**

View File

@ -56,9 +56,7 @@ class ResolvedFormType implements ResolvedFormTypeInterface
} }
/** /**
* Returns the prefix of the template block name for this type. * {@inheritdoc}
*
* @return string The prefix of the template block name
*/ */
public function getBlockPrefix() public function getBlockPrefix()
{ {

View File

@ -20,6 +20,13 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
*/ */
interface ResolvedFormTypeInterface interface ResolvedFormTypeInterface
{ {
/**
* Returns the prefix of the template block name for this type.
*
* @return string The prefix of the template block name
*/
public function getBlockPrefix();
/** /**
* Returns the parent type. * Returns the parent type.
* *