/**
  * @param Element $element
  * @param $entity
  */
 private function flush(Element $element, $entity)
 {
     $om = $element->getObjectManager();
     $om->flush();
 }
 /**
  * @param Element $element
  * @param $entity
  */
 private function persistAndFlush(Element $element, $entity)
 {
     $om = $element->getObjectManager();
     $om->persist($entity);
     $om->flush();
 }