Пример #1
0
 public function preSetData(FormEvent $event)
 {
     $data = $event->getData();
     $form = $event->getForm();
     if (null === $data) {
         return;
     }
     $libro = $data->getLibro() ? $data->getLibro() : null;
     if (null === $libro) {
         $pmbok = new Pmbok();
         $pmbok->setId(0);
     } else {
         if ($libro->getEsPmbok() == 1) {
             $pmbok = $data->getLibro()->getPmbok();
         } else {
             $pmbok = new Pmbok();
             $pmbok->setId(0);
         }
     }
     $this->agregarAreaForm($form, $pmbok);
 }
 public function preBind(FormEvent $event)
 {
     $data = $event->getData();
     $form = $event->getForm();
     if (null === $data) {
         return;
     }
     $libro = array_key_exists('libro', $data) ? $data['libro'] : null;
     if (null === $libro) {
         $pmbok = new Pmbok();
         $pmbok->setId(0);
     } else {
         if ($libro->getEsPmbok() == 1) {
             $pmbok = $data->getLibro()->getPmbok();
         } else {
             $pmbok = new Pmbok();
             $pmbok->setId(0);
         }
     }
     $this->agregarTrianguloForm($form, $pmbok);
 }
 /**
  * {@inheritDoc}
  */
 public function __toString()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, '__toString', array());
     return parent::__toString();
 }