propel-bundle/Form/BaseAbstractType.php
William DURAND a758f32421 Fix CS
2013-01-11 18:57:24 +01:00

62 lines
1.2 KiB
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace Propel\PropelBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
abstract class BaseAbstractType extends AbstractType
{
protected $options = array(
'name' => '',
);
public function __construct($mergeOptions = null)
{
if ($mergeOptions) {
$this->mergeOptions($mergeOptions);
}
}
public function setOption($name, $value)
{
$this->options[$name] = $value;
}
public function getOption($name)
{
return $this->options[$name];
}
public function setOptions($options)
{
$this->options = $options;
}
public function getOptions()
{
return $this->options;
}
public function mergeOptions($options)
{
$this->options = array_merge($this->options, $options);
}
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults($this->options);
}
/**
* {@inheritdoc}
*/
public function getName()
{
return $this->getOption('name');
}
}