Skip to content

Commit

Permalink
Only trigger requireIndex deprecation message if it's enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus committed Oct 17, 2017
1 parent 01820c0 commit 88a01ac
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -879,10 +879,13 @@ public function addIndex($keys, array $options = array())
*/
public function setRequireIndexes($requireIndexes)
{
@trigger_error(
'requireIndexes was deprecated in version 1.2 and will be removed altogether in 2.0.',
E_USER_DEPRECATED
);
if ($requireIndexes) {
@trigger_error(
'requireIndexes was deprecated in version 1.2 and will be removed altogether in 2.0.',
E_USER_DEPRECATED
);
}

$this->requireIndexes = $requireIndexes;
}

Expand Down

0 comments on commit 88a01ac

Please sign in to comment.