l3pp4rd/DoctrineExtensions — pull request #240 by jmikola (2012-01-23 22:14:29+00:00)
Title: [Sluggable] Use anchored regex query in ODM adapter

Using an anchored regex query will take advantage of MongoDB indexes. See: http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-RegularExpressions

After implementing this fix on an older branch, I realized it builds upon: 96550fd512af1decc7042cfa8d77fd0f41f2111b. This commits adds the fix to replaceRelative() and also uses preg_quote() for escaping the slug in the MongoRegex pattern.

----

Note: after running bin/vendors, I noticed a ton of test failures attempting to run this test suite. I believe bin/vendors needs to be updated to account for recent changes in the doctrine/mongodb and mongodb-odm repositories.

Additionally, when I did have the test suite running with older vendor libs, I don't believe the code changed in this commit was even covered by the Sluggable test cases. That's certainly something to look into in the future.