How do I include record relationships in validation?
Yii/Active Record won't do this by default.  You'd need to manually add an exists validation rule to the typeId attribute to get it to behave like you're looking for.