示例#1
0
    public function getTransformerInfo(ColumnInfoInterface $columnInfo, ClassMetadataInfo $metadata)
    {
        if ('#' !== substr($columnInfo->getLabel(), 0, 1)) {
            return;
        }

        return array($this->transformer, array());
    }
 /**
  * {@inheritdoc}
  */
 public function getTransformerInfo(ColumnInfoInterface $columnInfo, ClassMetadata $metadata)
 {
     if ($this->class !== $metadata->getName()) {
         return;
     }
     foreach ($this->regexps as $regexp) {
         if (preg_match($regexp, $columnInfo->getLabel())) {
             return array($this->transformer, $this->options);
         }
     }
     return;
 }
 /**
  * Returns the transformer info for a column
  *
  * @param string              $class
  * @param ColumnInfoInterface $columnInfo
  *
  * @return array
  */
 protected function getTransformerInfo($class, ColumnInfoInterface $columnInfo)
 {
     $label = $columnInfo->getLabel();
     if (!isset($this->transformers[$class][$label])) {
         if (!isset($this->transformers[$class])) {
             $this->transformers[$class] = array();
         }
         $this->transformers[$class][$label] = $this->guesser->getTransformerInfo($columnInfo, $this->doctrine->getManagerForClass($class)->getClassMetadata($class));
         if (!$this->transformers[$class][$label]) {
             throw new UnknownColumnException(array($label), $class);
         }
     }
     return $this->transformers[$class][$label];
 }