You are here

protected function DefaultConfigEntityHandler::getConfigProperties in CMS Content Sync 2.1.x

Same name and namespace in other branches
  1. 8 src/Plugin/cms_content_sync/entity_handler/DefaultConfigEntityHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\entity_handler\DefaultConfigEntityHandler::getConfigProperties()
  2. 2.0.x src/Plugin/cms_content_sync/entity_handler/DefaultConfigEntityHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\entity_handler\DefaultConfigEntityHandler::getConfigProperties()

Get all config properties for this entity type.

Return value

array

3 calls to DefaultConfigEntityHandler::getConfigProperties()
DefaultConfigEntityHandler::pull in src/Plugin/cms_content_sync/entity_handler/DefaultConfigEntityHandler.php
Pull the remote entity.
DefaultConfigEntityHandler::push in src/Plugin/cms_content_sync/entity_handler/DefaultConfigEntityHandler.php
DefaultConfigEntityHandler::updateEntityTypeDefinition in src/Plugin/cms_content_sync/entity_handler/DefaultConfigEntityHandler.php

File

src/Plugin/cms_content_sync/entity_handler/DefaultConfigEntityHandler.php, line 167

Class

DefaultConfigEntityHandler
Class DefaultConfigEntityHandler, providing a minimalistic implementation for any config entity type.

Namespace

Drupal\cms_content_sync\Plugin\cms_content_sync\entity_handler

Code

protected function getConfigProperties() {

  /**
   * @var \Drupal\Core\Config\Entity\ConfigEntityTypeInterface $entity_type
   */
  $entity_type = \Drupal::entityTypeManager()
    ->getDefinition($this->entityTypeName);
  $properties = $entity_type
    ->getPropertiesToExport();
  if (!$properties) {
    return [];
  }
  $config_definition = \Drupal::service('config.typed')
    ->getDefinition($this->entityTypeName . '.' . $this->bundleName . '.*');
  if (empty($config_definition)) {
    return [];
  }
  $mapping = $config_definition['mapping'];
  $result = [];
  foreach ($properties as $property) {

    // Wrong information from webform schema definition...
    // Associative arrays are NOT sequences.
    if ('webform' === $this->entityTypeName && 'access' === $property) {
      $mapping[$property]['type'] = 'mapping';
    }
    $result[$property] = $mapping[$property];
  }
  return $result;
}