فهرست منبع

check if field mapped as sluggable is identifier only in entites, not mapped superclasses.

Paweł Jędrzejewski 13 سال پیش
والد
کامیت
81a5a65ac9
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      lib/Gedmo/Sluggable/Mapping/Driver/Xml.php

+ 1 - 1
lib/Gedmo/Sluggable/Mapping/Driver/Xml.php

@@ -82,7 +82,7 @@ class Xml extends BaseXml
                         'separator' => $this->_isAttributeSet($slug, 'separator') ?
                         'separator' => $this->_isAttributeSet($slug, 'separator') ?
                             $this->_getAttribute($slug, 'separator') : '-',
                             $this->_getAttribute($slug, 'separator') : '-',
                     );
                     );
-                    if ($meta->isIdentifier($field) && !$config['slugs'][$field]['unique']) {
+                    if (!$meta->isMappedSuperclass && $meta->isIdentifier($field) && !$config['slugs'][$field]['unique']) {
                         throw new InvalidMappingException("Identifier field - [{$field}] slug must be unique in order to maintain primary key in class - {$meta->name}");
                         throw new InvalidMappingException("Identifier field - [{$field}] slug must be unique in order to maintain primary key in class - {$meta->name}");
                     }
                     }
                 }
                 }