예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function getFormType($propertyName, FormType $formType = null)
 {
     if ($propertyName == 'fields') {
         if (!$formType) {
             return;
         }
         $options = array_map(function ($field) {
             return array('value' => $field, 'label' => $field);
         }, static::$fieldsList);
         $formType->setOptions($options);
     }
     return $formType;
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function getFormType($propertyName, FormType $formType = null)
 {
     if ($propertyName == 'scope') {
         //get the form type associated on the model we want
         $userFieldsFormType = \PopCode\Framework\Form\FormFactory::getFormType('FacebookAWD\\Plugin\\Connect\\Model\\SubscriptionFieldsPermission', 'fields');
         //set the options
         $formType->setOptions($userFieldsFormType->getOptions());
     }
     return $formType;
 }