public function removeAndFlush($entity, $withCascade = true) { $this->remove($entity, $withCascade); $this->flush(); return $entity; }