Skip to content

Commit

Permalink
adapt for symfony 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlie committed Nov 12, 2015
1 parent 9c38a1b commit 12ccb8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Form/Type/ChoiceTreeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class ChoiceTreeType extends ChoiceType
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$choiceList = $options['choice_list']->getAdaptedList();
// for symfony 2.7
$choiceList = method_exists($options['choice_list'], "getAdaptedList") ? $options['choice_list']->getAdaptedList(): $options['choice_list'];
if (!$choiceList && !is_array($options['choices']) && !$options['choices'] instanceof \Traversable) {
throw new LogicException('Either the option "choices" or "choice_list" must be set.');
}
Expand Down

0 comments on commit 12ccb8c

Please sign in to comment.