示例#1
0
 /**
  * {@inheritdoc}
  */
 public function getReadableValue(ConfigurationEntry $entry)
 {
     $cfg = $entry->getServerHandlerConfig();
     $trueValue = isset($cfg['true_text']) ? $cfg['true_text'] : 'true';
     $falseValue = isset($cfg['false_text']) ? $cfg['false_text'] : 'false';
     return $entry->getDenormalizedValue() == 1 ? $trueValue : $falseValue;
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function getReadableValue(ConfigurationEntry $entry)
 {
     $cfg = $entry->getServerHandlerConfig();
     if (isset($cfg['dictionary']) && isset($cfg['dictionary'][$entry->getDenormalizedValue()])) {
         return $cfg['dictionary'][$entry->getDenormalizedValue()];
     }
     return false;
 }
 /**
  * {@inheritdoc}
  */
 public function getReadableValue(ConfigurationEntry $entry)
 {
     $cfg = $entry->getServerHandlerConfig();
     if (!isset($cfg['toStringMethodName'])) {
         throw MissingConfigurationParameterException::create($entry, 'toStringMethodName');
     }
     $entity = $this->em->find($this->getEntityFqcn($entry), $entry->getDenormalizedValue());
     if (!$entity) {
         throw new \RuntimeException(sprintf('Unable to find entity "%s" with id "%s"', $this->getEntityFqcn($entry), $entry->getDenormalizedValue()));
     }
     return $entity->{$cfg['toStringMethodName']}();
 }