Mapping.Fixture.Xml.Sluggable.dcm.xml 1.6 KB

123456789101112131415161718192021222324252627282930
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
  3. xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping">
  4. <entity name="Mapping\Fixture\Xml\Sluggable" table="sluggables">
  5. <id name="id" type="integer" column="id">
  6. <generator strategy="AUTO"/>
  7. </id>
  8. <field name="title" type="string" length="128"/>
  9. <field name="code" type="string" length="16"/>
  10. <field name="ean" type="string" length="13"/>
  11. <field name="slug" type="string" length="156" unique="true">
  12. <gedmo:slug unique="true" style="camel" updatable="false" separator="_" fields="title, ean, code">
  13. <gedmo:handler class="Gedmo\Sluggable\Handler\TreeSlugHandler">
  14. <gedmo:handler-option name="parentRelationField" value="parent"/>
  15. <gedmo:handler-option name="separator" value="/"/>
  16. </gedmo:handler>
  17. <gedmo:handler class="Gedmo\Sluggable\Handler\RelativeSlugHandler">
  18. <gedmo:handler-option name="relationField" value="parent"/>
  19. <gedmo:handler-option name="relationSlugField" value="test"/>
  20. <gedmo:handler-option name="separator" value="-"/>
  21. </gedmo:handler>
  22. </gedmo:slug>
  23. </field>
  24. <many-to-one field="parent" target-entity="Sluggable">
  25. <join-column name="parent_id" referenced-column-name="id" on-delete="CASCADE"/>
  26. </many-to-one>
  27. </entity>
  28. </doctrine-mapping>