protected function makeValue(FcField $fc_field, &$data)
 {
     $value = $data[$fc_field->getName()];
     if ($value instanceof UploadedFile) {
         return $this->uploadFile($value);
     }
     return $this->field_chain->getField($fc_field->getType())->verboseValue($value, $fc_field);
 }
 public function validate(ErrorElement $errorElement, $object)
 {
     $errorElement->addConstraint(new UniqueObject(array('fields' => 'alias', 'message' => $this->trans('fc.label.admin.alias', array(), $this->getTranslationDomain()) . ': ' . $this->trans('fc.constraint.admin.not_unique', array(), 'validators'))));
     /** @var FcForm $object */
     if ($this->field_chain->hasField($object->getAlias())) {
         $errorElement->addViolation($this->trans('fc.message.admin.form.alias_conflicts', array(), $this->getTranslationDomain()));
     }
     if ($object->isColumnModified(FcFormPeer::IS_WIDGET) && !$object->getIsWidget() && $object->isUsedAsWidget()) {
         $errorElement->addViolation($this->trans('fc.message.admin.form.is_used_as_widget', array(), $this->getTranslationDomain()));
     }
 }
 public function getFcValue($value, FcField $fc_field)
 {
     if (null === $value || '' === $value) {
         return $value;
     }
     return $this->field_chain->getField($fc_field->getType())->verboseValue($value, $fc_field);
 }
 protected function buildTypeChoices()
 {
     $inbuilt = array();
     $custom = array();
     foreach ($this->field_chain->getFields() as $alias => $field) {
         $inbuilt[$alias] = $field->getName();
     }
     /** @var FcForm[] $fc_forms */
     $fc_forms = FcFormQuery::create()->filterByIsWidget(true)->orderByTitle()->find();
     foreach ($fc_forms as $fc_form) {
         if ($fc_form->getId() != $this->fc_form_id) {
             $custom[$fc_form->getAlias()] = $fc_form->getTitle();
         }
     }
     if (!empty($custom)) {
         return array('fc.label.admin.field.widget.inbuilt' => $inbuilt, 'fc.label.admin.field.widget.custom' => $custom);
     } else {
         return $inbuilt;
     }
 }
 protected function addField(FormBuilderInterface $builder, FcField $fc_field)
 {
     $field = $this->field_chain->getField($fc_field->getType());
     $field->buildField($this->constraint_chain, $builder, $fc_field);
 }