summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2014-03-21 02:31:32 (GMT)
committerwebchick2014-03-21 02:31:32 (GMT)
commit23902766aca0843edc61c208d67d2c0f08d834a4 (patch)
tree81da28eaa2e0c34a28aca7e03cf842d0534c9540
parent032c3986b13d54919dd32ed91f877639e3f65d43 (diff)
Issue #2219925 by tim.plunkett: Rename ConfigEntityInterface::getExportProperties() to toArray().
-rw-r--r--core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php2
-rw-r--r--core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php2
-rw-r--r--core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php2
-rw-r--r--core/modules/block/lib/Drupal/block/Entity/Block.php6
-rw-r--r--core/modules/breakpoint/lib/Drupal/breakpoint/Entity/BreakpointGroup.php2
-rw-r--r--core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageControllerTest.php4
-rw-r--r--core/modules/config/lib/Drupal/config/Tests/ConfigSingleImportExportTest.php2
-rw-r--r--core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php6
-rw-r--r--core/modules/entity/lib/Drupal/entity/Entity/EntityFormDisplay.php6
-rw-r--r--core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php2
-rw-r--r--core/modules/field/lib/Drupal/field/Entity/FieldConfig.php12
-rw-r--r--core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php14
-rw-r--r--core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php4
-rw-r--r--core/modules/image/lib/Drupal/image/Entity/ImageStyle.php4
-rw-r--r--core/modules/rdf/lib/Drupal/rdf/Entity/RdfMapping.php2
-rw-r--r--core/modules/search/lib/Drupal/search/Entity/SearchPage.php4
-rw-r--r--core/modules/serialization/lib/Drupal/serialization/Normalizer/ConfigEntityNormalizer.php2
-rw-r--r--core/modules/serialization/tests/Drupal/serialization/Tests/Normalizer/ConfigEntityNormalizerTest.php2
-rw-r--r--core/modules/system/lib/Drupal/system/Entity/Action.php4
-rw-r--r--core/modules/system/lib/Drupal/system/Entity/DateFormat.php4
-rw-r--r--core/modules/system/lib/Drupal/system/Entity/Menu.php4
-rw-r--r--core/modules/tour/lib/Drupal/tour/Entity/Tour.php6
-rw-r--r--core/modules/views/lib/Drupal/views/Entity/View.php4
-rw-r--r--core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php6
24 files changed, 53 insertions, 53 deletions
diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
index a370552..a02e515 100644
--- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
+++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
@@ -198,7 +198,7 @@ abstract class ConfigEntityBase extends Entity implements ConfigEntityInterface
/**
* {@inheritdoc}
*/
- public function getExportProperties() {
+ public function toArray() {
// Configuration objects do not have a schema. Extract all key names from
// class properties.
$class_info = new \ReflectionClass($this);
diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php
index 5aa737d..f3943fd 100644
--- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php
+++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php
@@ -120,6 +120,6 @@ interface ConfigEntityInterface extends EntityInterface {
* @return array
* An array of exportable properties and their values.
*/
- public function getExportProperties();
+ public function toArray();
}
diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php
index 234ad2a..d348a4f 100644
--- a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php
+++ b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php
@@ -328,7 +328,7 @@ class ConfigStorageController extends EntityStorageControllerBase implements Con
}
// Retrieve the desired properties and set them in config.
- foreach ($entity->getExportProperties() as $key => $value) {
+ foreach ($entity->toArray() as $key => $value) {
$config->set($key, $value);
}
diff --git a/core/modules/block/lib/Drupal/block/Entity/Block.php b/core/modules/block/lib/Drupal/block/Entity/Block.php
index cb49cac..e6d8f7e 100644
--- a/core/modules/block/lib/Drupal/block/Entity/Block.php
+++ b/core/modules/block/lib/Drupal/block/Entity/Block.php
@@ -127,10 +127,10 @@ class Block extends ConfigEntityBase implements BlockInterface, EntityWithPlugin
}
/**
- * Overrides \Drupal\Core\Config\Entity\ConfigEntityBase::getExportProperties();
+ * {@inheritdoc}
*/
- public function getExportProperties() {
- $properties = parent::getExportProperties();
+ public function toArray() {
+ $properties = parent::toArray();
$names = array(
'theme',
'region',
diff --git a/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/BreakpointGroup.php b/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/BreakpointGroup.php
index 80f10e0..19b4950 100644
--- a/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/BreakpointGroup.php
+++ b/core/modules/breakpoint/lib/Drupal/breakpoint/Entity/BreakpointGroup.php
@@ -196,7 +196,7 @@ class BreakpointGroup extends ConfigEntityBase implements BreakpointGroupInterfa
/**
* {@inheritdoc}
*/
- public function getExportProperties() {
+ public function toArray() {
$names = array(
'id',
'uuid',
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageControllerTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageControllerTest.php
index 5ab2ea4..12a1ede 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageControllerTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityStorageControllerTest.php
@@ -40,7 +40,7 @@ class ConfigEntityStorageControllerTest extends DrupalUnitTestBase {
entity_create($entity_type, array('id' => $id))->save();
$entity = entity_load($entity_type, $id);
- $original_properties = $entity->getExportProperties();
+ $original_properties = $entity->toArray();
// Override with a new UUID and try to save.
$new_uuid = $this->container->get('uuid')->generate();
@@ -56,7 +56,7 @@ class ConfigEntityStorageControllerTest extends DrupalUnitTestBase {
// Ensure that the config entity was not corrupted.
$entity = entity_load('config_test', $entity->id(), TRUE);
- $this->assertIdentical($entity->getExportProperties(), $original_properties);
+ $this->assertIdentical($entity->toArray(), $original_properties);
}
}
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigSingleImportExportTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigSingleImportExportTest.php
index fbd7497..8bd1b72 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigSingleImportExportTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigSingleImportExportTest.php
@@ -144,7 +144,7 @@ EOD;
$this->assertFieldByXPath('//select[@name="config_name"]//option[@selected="selected"]', t('Fallback date format'), 'The fallback date format config entity is selected when specified in the URL.');
$fallback_date = \Drupal::entityManager()->getStorageController('date_format')->load('fallback');
- $data = \Drupal::service('config.storage')->encode($fallback_date->getExportProperties());
+ $data = \Drupal::service('config.storage')->encode($fallback_date->toArray());
$this->assertFieldByXPath('//textarea[@name="export"]', $data, 'The fallback date format config entity export code is displayed.');
}
diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php
index 029a7ac..d7ac61c 100644
--- a/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php
+++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/Entity/ConfigTest.php
@@ -77,10 +77,10 @@ class ConfigTest extends ConfigEntityBase implements ConfigTestInterface {
protected $protected_property;
/**
- * Overrides \Drupal\Core\Config\Entity\ConfigEntityBase::getExportProperties();
+ * {@inheritdoc}
*/
- public function getExportProperties() {
- $properties = parent::getExportProperties();
+ public function toArray() {
+ $properties = parent::toArray();
$protected_names = array(
'protected_property',
);
diff --git a/core/modules/entity/lib/Drupal/entity/Entity/EntityFormDisplay.php b/core/modules/entity/lib/Drupal/entity/Entity/EntityFormDisplay.php
index 18b8dc5..9e3a6a8 100644
--- a/core/modules/entity/lib/Drupal/entity/Entity/EntityFormDisplay.php
+++ b/core/modules/entity/lib/Drupal/entity/Entity/EntityFormDisplay.php
@@ -149,7 +149,7 @@ class EntityFormDisplay extends EntityDisplayBase implements EntityFormDisplayIn
*/
public function __sleep() {
// Only store the definition, not external objects or derived data.
- $keys = array_keys($this->getExportProperties());
+ $keys = array_keys($this->toArray());
$keys[] = 'entityTypeId';
return $keys;
}
@@ -158,8 +158,8 @@ class EntityFormDisplay extends EntityDisplayBase implements EntityFormDisplayIn
* {@inheritdoc}
*/
public function __wakeup() {
- // Run the values from getExportProperties() through __construct().
- $values = array_intersect_key($this->getExportProperties(), get_object_vars($this));
+ // Run the values from self::toArray() through __construct().
+ $values = array_intersect_key($this->toArray(), get_object_vars($this));
$this->__construct($values, $this->entityTypeId);
}
diff --git a/core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php b/core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php
index 150b73b..fd3ddfe 100644
--- a/core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php
+++ b/core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php
@@ -158,7 +158,7 @@ abstract class EntityDisplayBase extends ConfigEntityBase implements EntityDispl
/**
* {@inheritdoc}
*/
- public function getExportProperties() {
+ public function toArray() {
$names = array(
'id',
'uuid',
diff --git a/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php b/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php
index e3aaea4..96e2cd1 100644
--- a/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php
+++ b/core/modules/field/lib/Drupal/field/Entity/FieldConfig.php
@@ -237,7 +237,7 @@ class FieldConfig extends ConfigEntityBase implements FieldConfigInterface {
/**
* {@inheritdoc}
*/
- public function getExportProperties() {
+ public function toArray() {
$names = array(
'id',
'uuid',
@@ -409,7 +409,7 @@ class FieldConfig extends ConfigEntityBase implements FieldConfigInterface {
$deleted_fields = $state->get('field.field.deleted') ?: array();
foreach ($fields as $field) {
if (!$field->deleted) {
- $config = $field->getExportProperties();
+ $config = $field->toArray();
$config['deleted'] = TRUE;
$config['bundles'] = $field->getBundles();
$deleted_fields[$field->uuid] = $config;
@@ -693,16 +693,16 @@ class FieldConfig extends ConfigEntityBase implements FieldConfigInterface {
* @todo Investigate in https://drupal.org/node/2074253.
*/
public function __sleep() {
- // Only serialize properties from getExportProperties().
- return array_keys(array_intersect_key($this->getExportProperties(), get_object_vars($this)));
+ // Only serialize properties from self::toArray().
+ return array_keys(array_intersect_key($this->toArray(), get_object_vars($this)));
}
/**
* Implements the magic __wakeup() method.
*/
public function __wakeup() {
- // Run the values from getExportProperties() through __construct().
- $values = array_intersect_key($this->getExportProperties(), get_object_vars($this));
+ // Run the values from self::toArray() through __construct().
+ $values = array_intersect_key($this->toArray(), get_object_vars($this));
$this->__construct($values);
}
diff --git a/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php b/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php
index 34b36f7..61add25 100644
--- a/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php
+++ b/core/modules/field/lib/Drupal/field/Entity/FieldInstanceConfig.php
@@ -259,7 +259,7 @@ class FieldInstanceConfig extends ConfigEntityBase implements FieldInstanceConfi
$this->field = $field;
// Discard the 'field_type' entry that is added in config records to ease
- // schema generation. See getExportProperties().
+ // schema generation. See self::toArray().
unset($values['field_type']);
// Check required properties.
@@ -288,7 +288,7 @@ class FieldInstanceConfig extends ConfigEntityBase implements FieldInstanceConfi
/**
* {@inheritdoc}
*/
- public function getExportProperties() {
+ public function toArray() {
$names = array(
'id',
'uuid',
@@ -381,7 +381,7 @@ class FieldInstanceConfig extends ConfigEntityBase implements FieldInstanceConfi
$deleted_instances = $state->get('field.instance.deleted') ?: array();
foreach ($instances as $instance) {
if (!$instance->deleted) {
- $config = $instance->getExportProperties();
+ $config = $instance->toArray();
$config['deleted'] = TRUE;
$deleted_instances[$instance->uuid] = $config;
}
@@ -619,16 +619,16 @@ class FieldInstanceConfig extends ConfigEntityBase implements FieldInstanceConfi
* @todo Investigate in https://drupal.org/node/2074253.
*/
public function __sleep() {
- // Only serialize properties from getExportProperties().
- return array_keys(array_intersect_key($this->getExportProperties(), get_object_vars($this)));
+ // Only serialize properties from self::toArray().
+ return array_keys(array_intersect_key($this->toArray(), get_object_vars($this)));
}
/**
* Implements the magic __wakeup() method.
*/
public function __wakeup() {
- // Run the values from getExportProperties() through __construct().
- $values = array_intersect_key($this->getExportProperties(), get_object_vars($this));
+ // Run the values from self::toArray() through __construct().
+ $values = array_intersect_key($this->toArray(), get_object_vars($this));
$this->__construct($values);
}
diff --git a/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php b/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php
index 4e6febf..cf3bd07 100644
--- a/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php
+++ b/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php
@@ -173,8 +173,8 @@ class FilterFormat extends ConfigEntityBase implements FilterFormatInterface, En
/**
* {@inheritdoc}
*/
- public function getExportProperties() {
- $properties = parent::getExportProperties();
+ public function toArray() {
+ $properties = parent::toArray();
// @todo Make self::$weight and self::$cache protected and add them here.
$names = array(
'filters',
diff --git a/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php b/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php
index 1b3c8db..2aef8fc 100644
--- a/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php
+++ b/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php
@@ -369,8 +369,8 @@ class ImageStyle extends ConfigEntityBase implements ImageStyleInterface, Entity
/**
* {@inheritdoc}
*/
- public function getExportProperties() {
- $properties = parent::getExportProperties();
+ public function toArray() {
+ $properties = parent::toArray();
$names = array(
'effects',
);
diff --git a/core/modules/rdf/lib/Drupal/rdf/Entity/RdfMapping.php b/core/modules/rdf/lib/Drupal/rdf/Entity/RdfMapping.php
index 2256dd4..f2d3257 100644
--- a/core/modules/rdf/lib/Drupal/rdf/Entity/RdfMapping.php
+++ b/core/modules/rdf/lib/Drupal/rdf/Entity/RdfMapping.php
@@ -136,7 +136,7 @@ class RdfMapping extends ConfigEntityBase implements RdfMappingInterface {
/**
* {@inheritdoc}
*/
- public function getExportProperties() {
+ public function toArray() {
$names = array(
'id',
'uuid',
diff --git a/core/modules/search/lib/Drupal/search/Entity/SearchPage.php b/core/modules/search/lib/Drupal/search/Entity/SearchPage.php
index 36444e0..ab902b5 100644
--- a/core/modules/search/lib/Drupal/search/Entity/SearchPage.php
+++ b/core/modules/search/lib/Drupal/search/Entity/SearchPage.php
@@ -163,8 +163,8 @@ class SearchPage extends ConfigEntityBase implements SearchPageInterface, Entity
/**
* {@inheritdoc}
*/
- public function getExportProperties() {
- $properties = parent::getExportProperties();
+ public function toArray() {
+ $properties = parent::toArray();
$names = array(
'path',
'weight',
diff --git a/core/modules/serialization/lib/Drupal/serialization/Normalizer/ConfigEntityNormalizer.php b/core/modules/serialization/lib/Drupal/serialization/Normalizer/ConfigEntityNormalizer.php
index 0879860..913672c 100644
--- a/core/modules/serialization/lib/Drupal/serialization/Normalizer/ConfigEntityNormalizer.php
+++ b/core/modules/serialization/lib/Drupal/serialization/Normalizer/ConfigEntityNormalizer.php
@@ -23,7 +23,7 @@ class ConfigEntityNormalizer extends EntityNormalizer {
* {@inheritdoc}
*/
public function normalize($object, $format = NULL, array $context = array()) {
- return $object->getExportProperties();
+ return $object->toArray();
}
}
diff --git a/core/modules/serialization/tests/Drupal/serialization/Tests/Normalizer/ConfigEntityNormalizerTest.php b/core/modules/serialization/tests/Drupal/serialization/Tests/Normalizer/ConfigEntityNormalizerTest.php
index 8958de0..795ad6d 100644
--- a/core/modules/serialization/tests/Drupal/serialization/Tests/Normalizer/ConfigEntityNormalizerTest.php
+++ b/core/modules/serialization/tests/Drupal/serialization/Tests/Normalizer/ConfigEntityNormalizerTest.php
@@ -43,7 +43,7 @@ class ConfigEntityNormalizerTest extends UnitTestCase {
$config_entity = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityInterface');
$config_entity->expects($this->once())
- ->method('getExportProperties')
+ ->method('toArray')
->will($this->returnValue($test_export_properties));
$this->assertSame($test_export_properties, $normalizer->normalize($config_entity));
diff --git a/core/modules/system/lib/Drupal/system/Entity/Action.php b/core/modules/system/lib/Drupal/system/Entity/Action.php
index 93b38f1..9f08e20 100644
--- a/core/modules/system/lib/Drupal/system/Entity/Action.php
+++ b/core/modules/system/lib/Drupal/system/Entity/Action.php
@@ -143,8 +143,8 @@ class Action extends ConfigEntityBase implements ActionConfigEntityInterface, En
/**
* {@inheritdoc}
*/
- public function getExportProperties() {
- $properties = parent::getExportProperties();
+ public function toArray() {
+ $properties = parent::toArray();
$names = array(
'type',
'plugin',
diff --git a/core/modules/system/lib/Drupal/system/Entity/DateFormat.php b/core/modules/system/lib/Drupal/system/Entity/DateFormat.php
index ce169b9..a03cac3 100644
--- a/core/modules/system/lib/Drupal/system/Entity/DateFormat.php
+++ b/core/modules/system/lib/Drupal/system/Entity/DateFormat.php
@@ -71,8 +71,8 @@ class DateFormat extends ConfigEntityBase implements DateFormatInterface {
/**
* {@inheritdoc}
*/
- public function getExportProperties() {
- $properties = parent::getExportProperties();
+ public function toArray() {
+ $properties = parent::toArray();
$names = array(
'locked',
'pattern',
diff --git a/core/modules/system/lib/Drupal/system/Entity/Menu.php b/core/modules/system/lib/Drupal/system/Entity/Menu.php
index b4abf10..8dadc1c 100644
--- a/core/modules/system/lib/Drupal/system/Entity/Menu.php
+++ b/core/modules/system/lib/Drupal/system/Entity/Menu.php
@@ -61,8 +61,8 @@ class Menu extends ConfigEntityBase implements MenuInterface {
/**
* {@inheritdoc}
*/
- public function getExportProperties() {
- $properties = parent::getExportProperties();
+ public function toArray() {
+ $properties = parent::toArray();
// @todo Make $description protected and include it here, see
// https://drupal.org/node/2030645.
$names = array(
diff --git a/core/modules/tour/lib/Drupal/tour/Entity/Tour.php b/core/modules/tour/lib/Drupal/tour/Entity/Tour.php
index f581488..5837e9a 100644
--- a/core/modules/tour/lib/Drupal/tour/Entity/Tour.php
+++ b/core/modules/tour/lib/Drupal/tour/Entity/Tour.php
@@ -120,10 +120,10 @@ class Tour extends ConfigEntityBase implements TourInterface {
}
/**
- * Overrides \Drupal\Core\Config\Entity\ConfigEntityBase::getExportProperties();
+ * {@inheritdoc}
*/
- public function getExportProperties() {
- $properties = parent::getExportProperties();
+ public function toArray() {
+ $properties = parent::toArray();
$names = array(
'routes',
'tips',
diff --git a/core/modules/views/lib/Drupal/views/Entity/View.php b/core/modules/views/lib/Drupal/views/Entity/View.php
index 8eea4c1..80c75b0 100644
--- a/core/modules/views/lib/Drupal/views/Entity/View.php
+++ b/core/modules/views/lib/Drupal/views/Entity/View.php
@@ -242,9 +242,9 @@ class View extends ConfigEntityBase implements ViewStorageInterface {
}
/**
- * Overrides \Drupal\Core\Config\Entity\ConfigEntityBase::getExportProperties();
+ * {@inheritdoc}
*/
- public function getExportProperties() {
+ public function toArray() {
$names = array(
'base_field',
'base_table',
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php
index f959d0d..5fca58f 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php
@@ -910,10 +910,10 @@ class ViewUI implements ViewStorageInterface {
}
/**
- * Implements \Drupal\Core\Entity\EntityInterface::getExportProperties().
+ * {@inheritdoc}
*/
- public function getExportProperties() {
- return $this->storage->getExportProperties();
+ public function toArray() {
+ return $this->storage->toArray();
}