Can I make csDoctrineActAsSortablePlugin not unique?
I am using symfony 1.4, doctrine and the csDoctrineAc开发者_如何学PythontAsSortablePlugin for sorting. But I only need it in subform, so that the uniqueness of the position is disturbing. Is there by any chance a posibility to make it not unique?
I am already thinking of doing it manually but if I can avoid to invent the wheel a second time, I am more than thankful.
Cheers!
Just by looking at the source, I think it's possible to disable the unique
option.
In your schema.yml
:
MyModel:
columns:
...
actAs:
Sortable:
unique: false
You could also use the uniqueBy
option to set the fieldname which references the parent. It will then create an unique index by both position
and the field. Something like this:
MyModel:
columns:
parent_id: ~
actAs:
Sortable:
uniqueBy: parent_id
精彩评论