diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php index a370552c504e6d1dee8abd461e14dc934fe0cff9..a02e5156da2b60720a318483d123b4bfc2a07908 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php @@ -198,7 +198,7 @@ public static function sort($a, $b) { /** * {@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 5aa737dd2961a3bea30d4d01e0135a3bf8eac1b7..f3943fd4407077b1a5a886d99ac4f2f47b6876e7 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php @@ -120,6 +120,6 @@ public function set($property_name, $value); * @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 234ad2adaec802b21e9b474568859f2251e1d098..d348a4f47c176a0fb07efbf419890c0458ad4488 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php @@ -328,7 +328,7 @@ public function save(EntityInterface $entity) { } // 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 cb49cace169eb286f17c5f29530a5892c0f90b2a..e6d8f7e4cb2b02181e2c663be2ef136b64299996 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 @@ public function label() { } /** - * 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 80f10e07a0f54399de7570152eb15bb30ad92f26..19b495027beb0d765e7b24df9759049ab9f1bed8 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 @@ public function getBreakpointById($id) { /** * {@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 5ab2ea46793fdbbf975e8589dc38d541740ad3e7..12a1ede81eab4ec6a50403bea767ac99f2d46fe2 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 @@ public function testUUIDConflict() { 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 @@ public function testUUIDConflict() { // 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 fbd7497175eebf068f9bc97e4eb75f6cc3a3395c..8bd1b722703c3d541683ac7b8770d55882a21d1c 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 @@ public function testExport() { $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 029a7ac0af8ac8671c7e71ab6957ebe3dcc366e2..d7ac61c5a8b895ec4ccaebd008030b44c8c2ea12 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 18b8dc5a110ae6b6d61e9725ff177fcbe10516a2..9e3a6a80d77f7f818b619fbe05eb34eeef73ef90 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 @@ public function getRenderer($field_name) { */ 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 @@ public function __sleep() { * {@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 150b73b57c714cdb3d5640d8e000870a482318b1..fd3ddfe49d269aa4a9eda73ab51dd02cd6f834f5 100644 --- a/core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php +++ b/core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php @@ -158,7 +158,7 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ /** * {@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 e3aaea4e8faada62807bf22b56d297b4247851a3..96e2cd11f56776f8d2272cd4088cb67e66afc817 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 @@ public function id() { /** * {@inheritdoc} */ - public function getExportProperties() { + public function toArray() { $names = array( 'id', 'uuid', @@ -409,7 +409,7 @@ public static function preDelete(EntityStorageControllerInterface $storage_contr $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 @@ public function hasData() { * @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 34b36f7e26224c23fa6822f5476a106e9b8f8658..61add25642220efbe7acf9b5f38d367a5b7a570a 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 @@ public function __construct(array $values, $entity_type = 'field_instance_config $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 @@ public function id() { /** * {@inheritdoc} */ - public function getExportProperties() { + public function toArray() { $names = array( 'id', 'uuid', @@ -381,7 +381,7 @@ public static function preDelete(EntityStorageControllerInterface $storage_contr $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 @@ public function targetBundle() { * @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 4e6febf46acf191c5cdb7e35506b56fcb58db418..cf3bd07c2025e0d24a192708574dc53b3a35d9ab 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 @@ public function setFilterConfig($instance_id, array $configuration) { /** * {@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 1b3c8dbe8be3936738170b5782a8e6c958c87485..2aef8fc5345c40bab027df3490230394f9fdfd2d 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 @@ public function saveImageEffect(array $configuration) { /** * {@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 2256dd42a57e79f63cc3061daa92d52b7000b75a..f2d325745c9ffc2742d84b1a40eca63c9386ce79 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 @@ public function id() { /** * {@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 36444e01ede8862e4f17622919f9ebc43f7c4627..ab902b564c8853ddc88c903f48b4c0538e30c203 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 @@ public function getWeight() { /** * {@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 0879860eee2ff0eed5608a4738c337fe2bbaef74..913672c83315c9290801b1d18197cd033894d130 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 8958de00e6e5460d41679228b2f892b3d45c4659..795ad6db7fa69feff19e45cb4d9df581ad6b4f40 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 @@ public function testNormalize() { $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 93b38f17084316e84678d08e9b2d083f2db1d8d3..9f08e20067fe8d4bfae079bbd85d195be77d4416 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 @@ public static function sort($a, $b) { /** * {@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 ce169b9a5188e2b044e07be4ce9249ab19f19064..a03cac3e4653cf903d8d2543680d98356e6b8b25 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 b4abf10a1d120b9a0724fc3a887a3dec6b231b26..8dadc1c61036a36a4610dc2918e83d0847573f98 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 f5814889ea92d73d864480a5901b4241888b2738..5837e9a7eb194a94881ecd31528966ba9fe1d7a8 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 @@ public function getTips() { } /** - * 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 8eea4c15a9b90b5738548ef07e6a3dbdd0f647b0..80c75b0edc8cd6bee6a7ec260f29ed5c8fe48287 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 @@ public function &getDisplay($display_id) { } /** - * 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 f959d0de7897d763dde425fa208538aa6330d5e6..5fca58f1dea1a3038f8b8fb00ceda9f63336831a 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 @@ public function enforceIsNew($value = TRUE) { } /** - * Implements \Drupal\Core\Entity\EntityInterface::getExportProperties(). + * {@inheritdoc} */ - public function getExportProperties() { - return $this->storage->getExportProperties(); + public function toArray() { + return $this->storage->toArray(); }