예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function getField($fieldName)
 {
     if (isset($this->fields[$fieldName])) {
         return $this->fields[$fieldName];
     }
     if (!$this->getFieldExists($fieldName)) {
         throw new NonexistentEntityException($this->translate('Field "{name}" does not exist in "{collection}".', ['name' => $fieldName, 'collection' => $this->getCollectionName()]));
     }
     $config = $this->config['fields'][$fieldName];
     $config['collectionName'] = $this->collectionName;
     $field = $this->metadataFactory->createField($fieldName, $config);
     return $this->fields[$fieldName] = $field;
 }