Invariant subspaces in Banach spaces of analytic functions