Hi everyone, although I have searched in various resources I cannot understand how to correctly insert the ‘status’ column, I will explain better.
I have two sql tables:
-table “numerazioni”
-table “gestionepc”
From the “gestionepc” form using dropdown I can select the “numerazione” column of the “numerazioni” table and so far everything works without problems. However, I need to insert the “status” column on the “numerazioni” table so that if I use a record in the “numerazioni” column, its “status” must automatically change to “Not active” as it is already used. For my project it is a requirement derived from the fact that I have various groups of user permissions and various authorizations.
In practice I have a lot of confusion on how to insert the status column (type of column, default value, storage also on the mysql database and initialize it) and on how to make it work through the code (perhaps using afterSave and beforeUpdate).
I read Active Record from Guide but I don’t understand.
Thanks