You can't access a constant like you do with a static property, the constant function is your solution :
$type = constant('NP_PostTypeType::' . $postType);
But be careful, your $postType
case must match your NP_PostTypeType
constant names (currently not the case), you should update your NP_PostType class to :
abstract class NP_PostType extends BasicEnum {
const Event = "Event";
const Job = "Job";
const Quote = "Quote";
const Status = "Status";
const Video = "Video";
}