public function testGetter()
 {
     $formEntity = $this->getMock('Oro\\Bundle\\EmbeddedFormBundle\\Entity\\EmbeddedForm');
     $event = new EmbeddedFormSubmitBeforeEvent([], $formEntity);
     $this->assertSame($formEntity, $event->getFormEntity());
     $this->assertSame([], $event->getData());
 }
Esempio n. 2
0
 /**
  * @param EmbeddedFormSubmitBeforeEvent $event
  */
 public function onEmbeddedFormSubmit(EmbeddedFormSubmitBeforeEvent $event)
 {
     /** @var ChannelAwareInterface $form */
     $form = $event->getFormEntity();
     /** @var  Object */
     $data = $event->getData();
     if ($data instanceof ChannelAwareInterface) {
         $dataChannel = $form->getDataChannel();
         $data->setDataChannel($dataChannel);
     }
 }