Should there be a private setType method which validates that the $type is in the allowedTypes array?