Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

set the default data class automatically

  • Loading branch information...
commit c84f1fe94ce44dcd389b6862f72a6622e5bd03fa 1 parent 685e696
@dbu dbu authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 Form/Type/ImageType.php
View
6 Form/Type/ImageType.php
@@ -3,6 +3,7 @@
namespace Doctrine\Bundle\PHPCRBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
+use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\Bundle\PHPCRBundle\Form\DataTransformer\ModelToFileTransformer;
@@ -23,4 +24,9 @@ public function buildForm(FormBuilderInterface $builder, array $options)
$transformer = new ModelToFileTransformer();
$builder->addModelTransformer($transformer);
}
+
+ public function setDefaultOptions(OptionsResolverInterface $options)
+ {
+ $options->setDefaults(array('data_class' => 'Doctrine\ODM\PHPCR\Document\Image'));
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.