SmsMessageDirection.php in SMS Framework 2.1.x
File
src/Plugin/views/field/SmsMessageDirection.php
View source
<?php
declare (strict_types=1);
namespace Drupal\sms\Plugin\views\field;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\views\ResultRow;
use Drupal\sms\Direction;
class SmsMessageDirection extends FieldPluginBase {
public function render(ResultRow $values) {
switch ($this
->getValue($values)) {
case Direction::INCOMING:
return $this
->t('Incoming');
case Direction::OUTGOING:
return $this
->t('Outgoing');
default:
return $this
->t('Unknown direction');
}
}
}