Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation notice when calling DocumentRepository->clear() since 2.4.0 #2526

Closed
TranquilCapybara16493 opened this issue Apr 5, 2023 · 2 comments
Milestone

Comments

@TranquilCapybara16493
Copy link

Q A
Version 2.4.0+

Support Question

Since in 2.4.0 deprecation notices were introduced in b261884

Following deprecation notice is triggered
PHP Deprecated: Since doctrine/mongodb-odm 2.4: Calling Doctrine\ODM\MongoDB\DocumentManager::clear() with any arguments to clear specific documents is deprecated and will not be supported in Doctrine ODM 3.0. in /var/www/project/vendor/symfony/deprecation-contracts/function.php on line 25

whenever DocumentRepository->clear() method is called because it passes an argument to DocumentManager

public function clear(): void
{
$this->dm->clear($this->class->rootDocumentName);
}

public function clear($objectName = null)
{
if ($objectName !== null) {
trigger_deprecation(
'doctrine/mongodb-odm',
'2.4',
'Calling %s() with any arguments to clear specific documents is deprecated and will not be supported in Doctrine ODM 3.0.',
__METHOD__
);
}
$this->unitOfWork->clear($objectName);

Is there any intent to either deprecate DocumentRepository->clear() or what should be a proper course of action in this case?

@malarzm
Copy link
Member

malarzm commented Apr 5, 2023

Is there any intent to either deprecate DocumentRepository->clear() or what should be a proper course of action in this case?

Yes, DocumentRepository::clear should have been deprecated in 2.4 along with the original deprecation, not doing so was our bad. We'll add the deprecation in 2.5.x :)

@malarzm malarzm added this to the 2.5.2 milestone Apr 5, 2023
@malarzm malarzm modified the milestones: 2.5.2, 2.5.3 Apr 13, 2023
@malarzm malarzm modified the milestones: 2.5.3, 2.5.4 Oct 23, 2023
@malarzm malarzm modified the milestones: 2.5.4, 2.5.5 Nov 3, 2023
@alcaeus alcaeus modified the milestones: 2.5.5, 2.6.0 Nov 24, 2023
@alcaeus
Copy link
Member

alcaeus commented Nov 24, 2023

I've opened #2584 to deprecate this in 2.6.0, as required by Semver.

@alcaeus alcaeus closed this as completed Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants