From accb888e8aed8e6aa8ca4828a59b78b41e2e48de Mon Sep 17 00:00:00 2001 From: Sergii Kliuchnyk Date: Sat, 10 Nov 2012 13:02:32 +0200 Subject: [PATCH] moved BaseAbstractType Model\Form to Form --- Form/BaseAbstractType.php | 61 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Form/BaseAbstractType.php diff --git a/Form/BaseAbstractType.php b/Form/BaseAbstractType.php new file mode 100644 index 0000000..26fd39b --- /dev/null +++ b/Form/BaseAbstractType.php @@ -0,0 +1,61 @@ + '', + ); + + 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'); + } +}