| 1234567891011121314151617181920212223 |
- <?php
- namespace cx_newsletter;
- class campaign_type_converter
- extends enum_converter
- implements enum_converter_interface {
- public function load_string(string $target) : self {
- $this->target = match ($target) {
- 'SMS' => campaign_type::sms,
- 'EMAIL' => campaign_type::email
- };
- return $this;
- }
- public function get_string() : string {
- return match ($this->target) {
- campaign_type::sms => 'SMS',
- campaign_type::email => 'EMAIL'
- };
- }
- }
|