private static function getMapById() { static $constants; if (null === $constants) { $reflection = new \ReflectionClass(__CLASS__); $constants = array_flip($reflection->getConstants()); } return $constants; }