Symfony2 entity field type alternatives to “property” or “__toString()”?

后端 未结 3 1646
后悔当初
后悔当初 2020-12-13 07:05

Using Symfony2 entity field type one should specify property option:

$builder->add(\'customers\', \'entity\', array(
    \'multiple\' =>          


        
3条回答
  •  离开以前
    2020-12-13 07:56

    It seems this can be achievable by adding following block after elseif ($this->labelPath) block in ObjectChoiceList.php.

    elseif (is_callable($this->labelPath)) {
      $labels[$i] = call_user_func($this->labelPath, $choice);
    }
    

    Haven't tried it though :).

提交回复
热议问题