Explorar o código

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

Paweł Jędrzejewski %!s(int64=13) %!d(string=hai) anos
pai
achega
81a5a65ac9
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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') ?
                             $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}");
                     }
                 }