should likely be ``if (!$manager->contains($document)) {``