/**
  * Tests ConfigEntityMapper::getOverviewRouteParameters().
  */
 public function testGetOverviewRouteParameters()
 {
     $entity_type = $this->getMock('Drupal\\Core\\Entity\\EntityTypeInterface');
     $this->entityManager->expects($this->once())->method('getDefinition')->with('language_entity')->will($this->returnValue($entity_type));
     $this->configEntityMapper->setEntity($this->entity);
     $this->entity->expects($this->once())->method('id')->with()->will($this->returnValue('entity_id'));
     $result = $this->configEntityMapper->getOverviewRouteParameters();
     $this->assertSame(array('language_entity' => 'entity_id'), $result);
 }
 /**
  * {@inheritdoc}
  */
 public function setEntity(ConfigEntityInterface $entity)
 {
     parent::setEntity($entity);
     // Adds the title label to the translation form.
     $node_type = $entity->id();
     $this->addConfigName("core.base_field_override.node.{$node_type}.title");
 }
Exemple #3
0
 /**
  * {@inheritdoc}
  */
 public function setEntity(ConfigEntityInterface $entity)
 {
     parent::setEntity($entity);
     // Adds the title label to the translation form.
     $node_type = $entity->id();
     $config = $this->configFactory->get("core.base_field_override.node.{$node_type}.title");
     if (!$config->isNew()) {
         $this->addConfigName($config->getName());
     }
 }
 /**
  * {@inheritdoc}
  */
 public function setEntity(ConfigEntityInterface $entity)
 {
     if (parent::setEntity($entity)) {
         // Field storage config can also contain translatable values. Add the name
         // of the config as well to the list of configs for this entity.
         /** @var \Drupal\field\FieldStorageConfigInterface $field_storage */
         $field_storage = $this->entity->getFieldStorageDefinition();
         /** @var \Drupal\Core\Config\Entity\ConfigEntityTypeInterface $entity_type_info */
         $entity_type_info = $this->entityManager->getDefinition($field_storage->getEntityTypeId());
         $this->addConfigName($entity_type_info->getConfigPrefix() . '.' . $field_storage->id());
         return TRUE;
     }
     return FALSE;
 }