Mechanical modelling of phagocytosis and constricted migration