public function postPersist(LifeCycleEventArgs $args)
    {
        $entity = $args->getEntity();
        $entityManager = $args->getEntityManager();

        if ($entity instanceof ValueInterface && $entity->isEmpty()) {
            $entityManager->remove($entity);
        }
    }
public function postPersist(LifeCycleEventArgs $args)
    {
        $entity = $args->getEntity();
        $entityManager = $args->getEntityManager();

        if ($entity instanceof ValueInterface && $entity->isEmpty()) {
            $entityManager->remove($entity);
        }
    }
public function postPersist ( LifeCycleEventArgs $ args ) { $ entity = $ args -> getEntity ( ) ; $ entityManager = $ args -> getEntityManager ( ) ; if ( $ entity instanceof ValueInterface && $ entity -> isEmpty ( ) ) { $ entityManager -> remove ( $ entity ) ; } }
Remove empty values after persisting, to avoid null 'Value' values in
the database.

@param LifeCycleEventArgs $args
Remove empty values after persisting to avoid null Value values in the database .