Skip to content

Commit

Permalink
Disable creation of document indexes for mapped superclasses, as they…
Browse files Browse the repository at this point in the history
… have no collection
  • Loading branch information
ornicar authored and jwage committed Oct 18, 2010
1 parent 4fbcef3 commit 1f8aac0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Doctrine/ODM/MongoDB/SchemaManager.php
Expand Up @@ -60,6 +60,10 @@ public function ensureIndexes()
public function ensureDocumentIndexes($documentName)
{
$class = $this->dm->getClassMetadata($documentName);
// mapped superclasses have no mongodb collection
if($class->isMappedSuperclass) {
return;
}
if ($indexes = $class->getIndexes()) {
$collection = $this->dm->getDocumentCollection($class->name);
foreach ($indexes as $index) {
Expand Down

0 comments on commit 1f8aac0

Please sign in to comment.