I'm not sure what the correct wording of my question is, but I added an enum
(NP_PostTypeType
) because I need to know what the type of each item in my initial enum (NP_PostType
) is.
I store the current PostType in $postType
which gets fed into a method and now in that method I need to extract the type for each type.
What I tried doing was: switch(NP_PostTypeType::$type)
, but this yields: Fatal error: Access to undeclared static property: NP_PostTypeType::$type
These are my 2 enums:
abstract class NP_PostType extends BasicEnum {
const Event = "event";
const Job = "job";
const Quote = "quote";
const Status = "status";
const Video = "video";
}
abstract class NP_PostTypeType extends BasicEnum {
const Event = "type";
const Job = "type";
const Quote = "format";
const Status = "format";
const Video = "format";
}
How do I go about this?