My project has an Article
kind. Then, there is a Block
kind. Each Block
has an article as parent entity; therefore, each article is made up of several Block
entities. Each Block
has an order property so the end-user can order them.
On the frontend, users can add a new Block
or update an existing one. Obviously, by moving a Block
up, it changes its own order but fatally, it also changes (+1) each of the subsequent Block
entities.
So far, for every update the user saves, I retrieve all Block
entities with an order equal or greater than the newly saved one, and update each of them.
Is there are way to simply update one property (order
) using the PHP library?