openquestions-1.0.x-dev/src/Service/OQUtilsInterface.php
src/Service/OQUtilsInterface.php
<?php
namespace Drupal\openquestions\Service;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Logger\LoggerChannelInterface;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Drupal\openquestions\Model\VoteDataBasic;
use Drupal\Core\Entity\EntityTypeManager;
use Drupal\Core\StringTranslation\TranslationManager;
/**
* Interface for our utils.
*/
interface OQUtilsInterface {
/**
* Convert one or more lines of "key|value|modifier" triplets into an array.
*/
public function parseStringList($s, $modifiers = []);
/**
* Convert the output of parseStringList into an array suitable for
* use with a FAPI select.
*/
public function stringListToOptions(array $items);
/**
* Given an entity and the name of a reference field, return the
* first reference or NULL.
*/
public function getFirstReference($entity, $fieldName);
}
