Is it possible to have multiple slugs on one table in Doctrine?
I tried this in my yaml-file:
Article:
tableName: tst_article
actAs:
Sluggable:
unique: true
fields: [title]
canUpdate: true
Sluggable:
unique: true
fields: [text]
name: secondSlug
columns:
id:
type: integer(8)
primary: true
autoincrement: true
category_id:
type: integer(8)
title:
type: text(255)
text:
type: clob
But after generating the sql only the secondSlug was generated...
Although changing libraries is not recommended, sometimes it's a necessary evil. A very small change allows you to declare
Sluggable_1
,Sluggable_2
, etc. in your YAML.It is possible. In your table definition write:
The problem is in YAML itself. You have something like this:
What might be translated into:
So as you see there is definition of
keyB
and thenkeyB
is overwritten with new value. So in your YAML file second definition overrides the first one.How to solve that? I don't know, but I'll do some researches. Right now you're forced to declare your models in pure PHP.