public function createNewFilename()
 {
     $nameComponents = array();
     $nameComponents[] = $this->getDocDate()->format('y-m-d');
     if ($this->getScanningNumber() > 0) {
         $nameComponents[] = $this->getScanningNumber();
     }
     if ($this->getPaymentStatus() != PaymentStatus::NOT_APPLICABLE) {
         $nameComponents[] = PaymentStatus::getFileComponent($this->getPaymentStatus());
     }
     $nameComponents[] = $this->getNote();
     return join(' - ', $nameComponents) . '.pdf';
 }
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('category', 'choice', array('choices' => Category::createChoices(), 'expanded' => true, 'multiple' => false, 'required' => true))->add('docDate', 'date', array('widget' => 'single_text', 'format' => 'yyyy-MM-dd', 'datepicker' => true, 'required' => true))->add('scanningNumber', 'text', array('label' => 'Scan #', 'required' => false))->add('paymentStatus', 'choice', array('choices' => PaymentStatus::createChoices(), 'expanded' => true, 'multiple' => false, 'required' => true, 'label' => 'Payment'))->add('note', 'text', array('label' => 'Note', 'required' => true));
 }