$remove = $this->getEm()->getRepository('MainBundle:Something')->findOneBy([],['id'=>'ASC']);
$this->getEm()->remove($remove);
$city = new City();
$city->setName(date('U'));
$this->getEm()->persist($city);
$this->getEm()->flush($city);
/**
* Only flushes the given entity according to a ruleset that keeps the UoW consistent.
*
* 1. All entities scheduled for insertion, (orphan) removals and changes in collections are processed as well!
* 2. Read Only entities are skipped.
* 3. Proxies are skipped.
* 4. Only if entity is properly managed.
*
* @param object $entity
*
* @return void
*
* @throws \InvalidArgumentException
*/
private function computeSingleEntityChangeSet($entity)