You want to switch it to readonly, based on some rule? You can build that into the Validator object set in the Entity, which is called when a field is set. You can there return false if you don't want the field to be set.
But I'm not sure in which context you want to use this, so if you could elaborate on that abit, it would be great