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

Deprecate DocumentRepository::clear #2584

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/Doctrine/ODM/MongoDB/Repository/DocumentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use function assert;
use function count;
use function is_array;
use function trigger_deprecation;

/**
* A DocumentRepository serves as a repository for documents with generic as well as
Expand Down Expand Up @@ -89,9 +90,18 @@ public function createAggregationBuilder(): AggregationBuilder

/**
* Clears the repository, causing all managed documents to become detached.
*
* @deprecated Deprecated in 2.6, will be removed in 3.0
*/
public function clear(): void
{
trigger_deprecation(
'doctrine/mongodb-odm',
'2.6',
'The %s() method is deprecated and will be removed in Doctrine ODM 3.0.',
__METHOD__,
);

$this->dm->clear($this->class->rootDocumentName);
}

Expand Down