I started to learn Atk just a week ago and I decided to reimplement the business intranet which is becoming unmaintainable.
The model abstraction is very cool to use but I wonder how to specify multiple primary keys for my junction tables.
For example, I have sites and I want to assign machines on them for a period.
Junction table
This is very important to me to not touch the database.
I guess you can do that using joins
in your Models if you're not allowed to add simple auto_incremented id
field in that junction table.
But adding id
field will be much more easier for you and also will work better in future.
For example, you can have some issues with deleting record without unique id field. I know (id_machine,id_site) is most likely unique in your case, but it's still hard to work with. One simple id field is easier, faster and better :)
Dark has a good suggestion. You can also create a calculated ID field, I have never tried it myself but do try it
$model->getElement('id')->destroy();
$model->addExpression('id')->set('contact(id_machine,"-",id_site)');