I am wanting to iterate through all database entries and replace the index with a new integer based on an array sent to the server in a form post.
So far I have this:
 /**
     * Order
     *
     * @Route("/order", name="cms_journey_order")
     * @Method("POST")
     * @Template()
     */
    public function orderAction(Request $id)
    {
        $em = $this->getDoctrine()->getManager();
        $entities = $em->getRepository('LVBundle:Journey')->getById($id);
        // SOME LOOP GOES HERE TO ADD NEW INDEX TO $ID FIELD IN DB
        return array(
            'entities' => $entities,
        );
    }
I guess I need something like a for loop, where each entity is rewritten?
