public function persistAndFlush(IEntity $entity, $withCascade = true) { $this->persist($entity, $withCascade); $this->flush(); return $entity; }