original_string: public function add(EntityInterface $entity)
      {
          if (!is_a($entity, $this->getEntityClass())) {
              throw new Exception('The given entity (' . get_class($entity) . ') is not compatible with this data source (' . self::class . '.');
          }
          
          try {
              $em = $this->entityManager->getDoctrineEntityManager();
              $em->persist($entity);
              $em->flush();
              
              return $entity->getId();
          } catch (\Exception $e) {
              throw new Exception('Cannot add the entity "' . $entity . '".', 0, $e);
          }
      }
code: public function add(EntityInterface $entity)
      {
          if (!is_a($entity, $this->getEntityClass())) {
              throw new Exception('The given entity (' . get_class($entity) . ') is not compatible with this data source (' . self::class . '.');
          }
          
          try {
              $em = $this->entityManager->getDoctrineEntityManager();
              $em->persist($entity);
              $em->flush();
              
              return $entity->getId();
          } catch (\Exception $e) {
              throw new Exception('Cannot add the entity "' . $entity . '".', 0, $e);
          }
      }
code_tokens: public function add ( EntityInterface $ entity ) { if ( ! is_a ( $ entity , $ this -> getEntityClass ( ) ) ) { throw new Exception ( 'The given entity (' . get_class ( $ entity ) . ') is not compatible with this data source (' . self :: class . '.' ) ; } try { $ em = $ this -> entityManager -> getDoctrineEntityManager ( ) ; $ em -> persist ( $ entity ) ; $ em -> flush ( ) ; return $ entity -> getId ( ) ; } catch ( \ Exception $ e ) { throw new Exception ( 'Cannot add the entity "' . $ entity . '".' , 0 , $ e ) ; } }
docstring: Adds an entity. Returns the id of the entity
  or false, if the entity can not inserted.
  
  @param \Zepi\DataSource\Core\Entity\EntityInterface $entity
  @return \Zepi\DataSource\Core\Entity\EntityInterface|false
  
  @throws \Zepi\DataSource\Doctrine\Exception The given entity is not compatible with this data source.
  @throws \Zepi\DataSource\Doctrine\Exception Cannot add the entity "{entity}".
docstring_tokens: Adds an entity . Returns the id of the entity or false if the entity can not inserted .