/**
  * @param form_persistentdocument_hidden $document
  * @param Integer $parentNodeId Parent node ID where to save the document (optionnal).
  * @return void
  */
 protected function preSave($document, $parentNodeId = null)
 {
     parent::preSave($document, $parentNodeId);
     $document->setRequired(false);
     $document->setHelpText(null);
     $recommand = $document->getIsRecommand();
     if (!empty($recommand)) {
         $document->setFieldName('recommandFeature');
     }
 }
 /**
  * @param form_persistentdocument_text $document
  * @param Integer $parentNodeId Parent node ID where to save the document (optionnal).
  * @return void
  */
 protected function preSave($document, $parentNodeId = null)
 {
     parent::preSave($document, $parentNodeId);
     $this->fixLengthConstraints($document);
     if ($document->getMultiline()) {
         if ($document->getRows() < 2) {
             $document->setRows(2);
         }
     } else {
         $document->setRows(1);
     }
 }