public function configure()
 {
     parent::configure();
     $this->checkFields('document');
     $this->setDefault('type', 'document');
     if ($this->getOption('user_id') && $this->isNew()) {
         $this->setDefault('created_by', $this->getOption('user_id'));
     }
 }
 public function configure()
 {
     parent::configure();
     $this->checkFields('event');
     $this->widgetSchema['date'] = new sfWidgetFormDate(array('format' => '%day%/%month%/%year%'));
     $this->setDefault('type', 'event');
     if ($this->getOption('user_id') && $this->isNew()) {
         $this->setDefault('created_by', $this->getOption('user_id'));
     }
 }