Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
304
Merge Requests
304
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
71d24791
Commit
71d24791
authored
Sep 08, 2014
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2330091
by plach: Rename ContentEntityDatabaseStorage to SqlContentEntityStorage.
parent
edafea1f
Changes
34
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
114 additions
and
109 deletions
+114
-109
core/includes/entity.inc
core/includes/entity.inc
+5
-5
core/lib/Drupal/Core/Entity/ContentEntityType.php
core/lib/Drupal/Core/Entity/ContentEntityType.php
+1
-1
core/lib/Drupal/Core/Entity/EntityStorageInterface.php
core/lib/Drupal/Core/Entity/EntityStorageInterface.php
+1
-1
core/lib/Drupal/Core/Entity/EntityTypeInterface.php
core/lib/Drupal/Core/Entity/EntityTypeInterface.php
+4
-4
core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php
+17
-12
core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
.../Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php
+6
-6
core/modules/aggregator/src/FeedStorage.php
core/modules/aggregator/src/FeedStorage.php
+4
-4
core/modules/aggregator/src/FeedStorageSchema.php
core/modules/aggregator/src/FeedStorageSchema.php
+1
-1
core/modules/aggregator/src/ItemStorage.php
core/modules/aggregator/src/ItemStorage.php
+4
-4
core/modules/aggregator/src/ItemStorageSchema.php
core/modules/aggregator/src/ItemStorageSchema.php
+1
-1
core/modules/block_content/src/BlockContentStorageSchema.php
core/modules/block_content/src/BlockContentStorageSchema.php
+1
-1
core/modules/block_content/src/Entity/BlockContent.php
core/modules/block_content/src/Entity/BlockContent.php
+1
-1
core/modules/comment/src/CommentStorage.php
core/modules/comment/src/CommentStorage.php
+3
-3
core/modules/comment/src/CommentStorageSchema.php
core/modules/comment/src/CommentStorageSchema.php
+1
-1
core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.module
.../modules/contact_storage_test/contact_storage_test.module
+2
-2
core/modules/content_translation/src/Tests/ContentTranslationTestBase.php
...tent_translation/src/Tests/ContentTranslationTestBase.php
+2
-2
core/modules/field/field.views.inc
core/modules/field/field.views.inc
+3
-3
core/modules/field/src/Tests/FieldAttachOtherTest.php
core/modules/field/src/Tests/FieldAttachOtherTest.php
+1
-1
core/modules/field/src/Tests/FieldDataCountTest.php
core/modules/field/src/Tests/FieldDataCountTest.php
+2
-2
core/modules/file/src/FileStorage.php
core/modules/file/src/FileStorage.php
+2
-2
core/modules/file/src/FileStorageSchema.php
core/modules/file/src/FileStorageSchema.php
+1
-1
core/modules/menu_link_content/src/Entity/MenuLinkContent.php
.../modules/menu_link_content/src/Entity/MenuLinkContent.php
+1
-1
core/modules/node/src/NodeStorage.php
core/modules/node/src/NodeStorage.php
+2
-2
core/modules/node/src/NodeStorageSchema.php
core/modules/node/src/NodeStorageSchema.php
+1
-1
core/modules/system/entity.api.php
core/modules/system/entity.api.php
+2
-2
core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php
core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php
+2
-2
core/modules/taxonomy/src/TermStorage.php
core/modules/taxonomy/src/TermStorage.php
+2
-2
core/modules/taxonomy/src/TermStorageSchema.php
core/modules/taxonomy/src/TermStorageSchema.php
+1
-1
core/modules/taxonomy/taxonomy.module
core/modules/taxonomy/taxonomy.module
+2
-2
core/modules/user/src/UserStorage.php
core/modules/user/src/UserStorage.php
+3
-3
core/modules/user/src/UserStorageSchema.php
core/modules/user/src/UserStorageSchema.php
+1
-1
core/modules/views/src/Tests/QueryGroupByTest.php
core/modules/views/src/Tests/QueryGroupByTest.php
+1
-1
core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
...sts/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
+7
-7
core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
...pal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php
+26
-26
No files found.
core/includes/entity.inc
View file @
71d24791
...
...
@@ -96,7 +96,7 @@ function entity_invoke_bundle_hook($hook, $entity_type, $bundle, $bundle_new = N
*
* @see \Drupal\Core\Entity\EntityManagerInterface
* @see \Drupal\Core\Entity\EntityStorageInterface
* @see \Drupal\Core\Entity\
ContentEntityDatabase
Storage
* @see \Drupal\Core\Entity\
Sql\SqlContentEntity
Storage
* @see \Drupal\Core\Entity\Query\QueryInterface
*/
function
entity_load
(
$entity_type
,
$id
,
$reset
=
FALSE
)
{
...
...
@@ -121,7 +121,7 @@ function entity_load($entity_type, $id, $reset = FALSE) {
*
* @see \Drupal\Core\Entity\EntityManagerInterface
* @see \Drupal\Core\Entity\EntityStorageInterface
* @see \Drupal\Core\Entity\
ContentEntityDatabase
Storage
* @see \Drupal\Core\Entity\
Sql\SqlContentEntity
Storage
*/
function
entity_revision_load
(
$entity_type
,
$revision_id
)
{
return
\
Drupal
::
entityManager
()
...
...
@@ -176,13 +176,13 @@ function entity_load_by_uuid($entity_type_id, $uuid) {
*
* The actual loading is done through a class that has to implement the
* Drupal\Core\Entity\EntityStorageInterface interface. By default,
* Drupal\Core\Entity\
ContentEntityDatabase
Storage is used for content entities
* Drupal\Core\Entity\
Sql\SqlContentEntity
Storage is used for content entities
* and Drupal\Core\Config\Entity\ConfigEntityStorage for config entities. Entity
* types can specify that a different class should be used by setting the
* "controllers['storage']" key in the entity plugin annotation. These classes
* can either implement the Drupal\Core\Entity\EntityStorageInterface
* interface, or, most commonly, extend the
* Drupal\Core\Entity\
ContentEntityDatabase
Storage class.
* Drupal\Core\Entity\
Sql\SqlContentEntity
Storage class.
* See Drupal\node\Entity\Node and Drupal\node\NodeStorage
* for an example.
*
...
...
@@ -198,7 +198,7 @@ function entity_load_by_uuid($entity_type_id, $uuid) {
*
* @see \Drupal\Core\Entity\EntityManagerInterface
* @see \Drupal\Core\Entity\EntityStorageInterface
* @see \Drupal\Core\Entity\
ContentEntityDatabase
Storage
* @see \Drupal\Core\Entity\
Sql\SqlContentEntity
Storage
* @see \Drupal\Core\Entity\Query\QueryInterface
*/
function
entity_load_multiple
(
$entity_type
,
array
$ids
=
NULL
,
$reset
=
FALSE
)
{
...
...
core/lib/Drupal/Core/Entity/ContentEntityType.php
View file @
71d24791
...
...
@@ -18,7 +18,7 @@ class ContentEntityType extends EntityType implements ContentEntityTypeInterface
public
function
__construct
(
$definition
)
{
parent
::
__construct
(
$definition
);
$this
->
handlers
+=
array
(
'storage'
=>
'Drupal\Core\Entity\
ContentEntityDatabase
Storage'
,
'storage'
=>
'Drupal\Core\Entity\
Sql\SqlContentEntity
Storage'
,
);
}
...
...
core/lib/Drupal/Core/Entity/EntityStorageInterface.php
View file @
71d24791
...
...
@@ -11,7 +11,7 @@
* Defines the interface for entity storage classes.
*
* For common default implementations, see
* \Drupal\Core\Entity\
ContentEntityDatabase
Storage for content entities and
* \Drupal\Core\Entity\
Sql\SqlContentEntity
Storage for content entities and
* \Drupal\Core\Config\Entity\ConfigEntityStorage for config entities. Those
* implementations are used by default when the @ContentEntityType or
* @ConfigEntityType annotations are used.
...
...
core/lib/Drupal/Core/Entity/EntityTypeInterface.php
View file @
71d24791
...
...
@@ -535,7 +535,7 @@ public function getBundleLabel();
/**
* Returns the name of the entity's base table.
*
* @todo Used by
ContentEntityDatabase
Storage only.
* @todo Used by
SqlContentEntity
Storage only.
*
* @return string|null
* The name of the entity's base table, or NULL if none exists.
...
...
@@ -572,7 +572,7 @@ public function getConfigPrefix();
/**
* Returns the name of the entity's revision data table.
*
* @todo Used by
ContentEntityDatabase
Storage only.
* @todo Used by
SqlContentEntity
Storage only.
*
* @return string|null
* The name of the entity type's revision data table, or NULL if none
...
...
@@ -583,7 +583,7 @@ public function getRevisionDataTable();
/**
* Returns the name of the entity's revision table.
*
* @todo Used by
ContentEntityDatabase
Storage only.
* @todo Used by
SqlContentEntity
Storage only.
*
* @return string|null
* The name of the entity type's revision table, or NULL if none exists.
...
...
@@ -593,7 +593,7 @@ public function getRevisionTable();
/**
* Returns the name of the entity's data table.
*
* @todo Used by
ContentEntityDatabase
Storage only.
* @todo Used by
SqlContentEntity
Storage only.
*
* @return string|null
* The name of the entity type's data table, or NULL if none exists.
...
...
core/lib/Drupal/Core/Entity/
ContentEntityDatabase
Storage.php
→
core/lib/Drupal/Core/Entity/
Sql/SqlContentEntity
Storage.php
View file @
71d24791
...
...
@@ -2,19 +2,24 @@
/**
* @file
* Contains \Drupal\Core\Entity\
ContentEntityDatabase
Storage.
* Contains \Drupal\Core\Entity\
Sql\SqlContentEntity
Storage.
*/
namespace
Drupal\Core\Entity
;
namespace
Drupal\Core\Entity
\Sql
;
use
Drupal\Component\Utility\String
;
use
Drupal\Core\Cache\CacheBackendInterface
;
use
Drupal\Core\Database\Connection
;
use
Drupal\Core\Database\Database
;
use
Drupal\Core\Entity\ContentEntityInterface
;
use
Drupal\Core\Entity\ContentEntityStorageBase
;
use
Drupal\Core\Entity\EntityInterface
;
use
Drupal\Core\Entity\EntityManagerInterface
;
use
Drupal\Core\Entity\EntityStorageException
;
use
Drupal\Core\Entity\EntityTypeInterface
;
use
Drupal\Core\Entity\EntityTypeListenerInterface
;
use
Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException
;
use
Drupal\Core\Entity\Query\QueryInterface
;
use
Drupal\Core\Entity\Sql\DefaultTableMapping
;
use
Drupal\Core\Entity\Sql\SqlEntityStorageInterface
;
use
Drupal\Core\Field\FieldDefinitionInterface
;
use
Drupal\Core\Field\FieldStorageDefinitionInterface
;
use
Drupal\Core\Language\LanguageInterface
;
...
...
@@ -26,15 +31,15 @@
* This class can be used as-is by most content entity types. Entity types
* requiring special handling can extend the class.
*
* The class uses \Drupal\Core\Entity\S
chema
\SqlContentEntityStorageSchema
* The class uses \Drupal\Core\Entity\S
ql
\SqlContentEntityStorageSchema
* internally in order to automatically generate the database schema based on
* the defined base fields. Entity types can override
*
ContentEntityDatabase
Storage::getSchema() to customize the generated
*
SqlContentEntity
Storage::getSchema() to customize the generated
* schema; e.g., to add additional indexes.
*
* @ingroup entity_api
*/
class
ContentEntityDatabase
Storage
extends
ContentEntityStorageBase
implements
SqlEntityStorageInterface
,
EntityTypeListenerInterface
{
class
SqlContentEntity
Storage
extends
ContentEntityStorageBase
implements
SqlEntityStorageInterface
,
EntityTypeListenerInterface
{
/**
* The mapping of field columns to SQL tables.
...
...
@@ -139,7 +144,7 @@ public function getFieldStorageDefinitions() {
}
/**
* Constructs a
ContentEntityDatabase
Storage object.
* Constructs a
SqlContentEntity
Storage object.
*
* @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
* The entity type definition.
...
...
@@ -220,12 +225,12 @@ public function getRevisionDataTable() {
/**
* Gets the schema handler for this entity storage.
*
* @return \Drupal\Core\Entity\S
chema
\SqlContentEntityStorageSchema
* @return \Drupal\Core\Entity\S
ql
\SqlContentEntityStorageSchema
* The schema handler.
*/
protected
function
schemaHandler
()
{
if
(
!
isset
(
$this
->
schemaHandler
))
{
$schema_handler_class
=
$this
->
entityType
->
getHandlerClass
(
'storage_schema'
)
?:
'Drupal\Core\Entity\S
chema
\SqlContentEntityStorageSchema'
;
$schema_handler_class
=
$this
->
entityType
->
getHandlerClass
(
'storage_schema'
)
?:
'Drupal\Core\Entity\S
ql
\SqlContentEntityStorageSchema'
;
$this
->
schemaHandler
=
new
$schema_handler_class
(
$this
->
entityManager
,
$this
->
entityType
,
$this
,
$this
->
database
);
}
return
$this
->
schemaHandler
;
...
...
@@ -1016,8 +1021,8 @@ protected function mapToStorageRecord(ContentEntityInterface $entity, $table_nam
* @return bool
* TRUE if the the column is serial, FALSE otherwise.
*
* @see \Drupal\Core\Entity\S
chema
\SqlContentEntityStorageSchema::processBaseTable()
* @see \Drupal\Core\Entity\S
chema
\SqlContentEntityStorageSchema::processRevisionTable()
* @see \Drupal\Core\Entity\S
ql
\SqlContentEntityStorageSchema::processBaseTable()
* @see \Drupal\Core\Entity\S
ql
\SqlContentEntityStorageSchema::processRevisionTable()
*/
protected
function
isColumnSerial
(
$table_name
,
$schema_name
)
{
$result
=
FALSE
;
...
...
core/lib/Drupal/Core/Entity/S
chema
/SqlContentEntityStorageSchema.php
→
core/lib/Drupal/Core/Entity/S
ql
/SqlContentEntityStorageSchema.php
View file @
71d24791
...
...
@@ -2,16 +2,16 @@
/**
* @file
* Contains \Drupal\Core\Entity\S
chema
\SqlContentEntityStorageSchema.
* Contains \Drupal\Core\Entity\S
ql
\SqlContentEntityStorageSchema.
*/
namespace
Drupal\Core\Entity\S
chema
;
namespace
Drupal\Core\Entity\S
ql
;
use
Drupal\Core\Database\Connection
;
use
Drupal\Core\Entity\ContentEntityDatabaseStorage
;
use
Drupal\Core\Entity\ContentEntityTypeInterface
;
use
Drupal\Core\Entity\EntityManagerInterface
;
use
Drupal\Core\Entity\EntityTypeInterface
;
use
Drupal\Core\Entity\Schema\EntitySchemaHandlerInterface
;
/**
* Defines a schema handler that supports revisionable, translatable entities.
...
...
@@ -35,7 +35,7 @@ class SqlContentEntityStorageSchema implements EntitySchemaHandlerInterface {
/**
* The storage object for the given entity type.
*
* @var \Drupal\Core\Entity\
ContentEntityDatabase
Storage
* @var \Drupal\Core\Entity\
Sql\SqlContentEntity
Storage
*/
protected
$storage
;
...
...
@@ -60,12 +60,12 @@ class SqlContentEntityStorageSchema implements EntitySchemaHandlerInterface {
* The entity manager.
* @param \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type
* The entity type.
* @param \Drupal\Core\Entity\
ContentEntityDatabase
Storage $storage
* @param \Drupal\Core\Entity\
Sql\SqlContentEntity
Storage $storage
* The storage of the entity type. This must be an SQL-based storage.
* @param \Drupal\Core\Database\Connection $database
* The database connection to be used.
*/
public
function
__construct
(
EntityManagerInterface
$entity_manager
,
ContentEntityTypeInterface
$entity_type
,
ContentEntityDatabase
Storage
$storage
,
Connection
$database
)
{
public
function
__construct
(
EntityManagerInterface
$entity_manager
,
ContentEntityTypeInterface
$entity_type
,
SqlContentEntity
Storage
$storage
,
Connection
$database
)
{
$this
->
entityType
=
$entity_type
;
$this
->
fieldStorageDefinitions
=
$entity_manager
->
getFieldStorageDefinitions
(
$entity_type
->
id
());
$this
->
storage
=
$storage
;
...
...
core/modules/aggregator/src/FeedStorage.php
View file @
71d24791
...
...
@@ -7,15 +7,15 @@
namespace
Drupal\aggregator
;
use
Drupal\Core\Entity\
ContentEntityDatabase
Storage
;
use
Drupal\Core\Entity\
Sql\SqlContentEntity
Storage
;
/**
* Controller class for aggregator's feeds.
*
* This extends the Drupal\Core\Entity\
ContentEntityDatabaseStorage class,
*
adding
required special handling for feed entities.
* This extends the Drupal\Core\Entity\
Sql\SqlContentEntityStorage class, adding
* required special handling for feed entities.
*/
class
FeedStorage
extends
ContentEntityDatabase
Storage
implements
FeedStorageInterface
{
class
FeedStorage
extends
SqlContentEntity
Storage
implements
FeedStorageInterface
{
/**
* {@inheritdoc}
...
...
core/modules/aggregator/src/FeedStorageSchema.php
View file @
71d24791
...
...
@@ -8,7 +8,7 @@
namespace
Drupal\aggregator
;
use
Drupal\Core\Entity\ContentEntityTypeInterface
;
use
Drupal\Core\Entity\S
chema
\SqlContentEntityStorageSchema
;
use
Drupal\Core\Entity\S
ql
\SqlContentEntityStorageSchema
;
/**
* Defines the feed schema handler.
...
...
core/modules/aggregator/src/ItemStorage.php
View file @
71d24791
...
...
@@ -7,16 +7,16 @@
namespace
Drupal\aggregator
;
use
Drupal\Core\Entity\ContentEntityDatabaseStorage
;
use
Drupal\Core\Entity\Query\QueryInterface
;
use
Drupal\Core\Entity\Sql\SqlContentEntityStorage
;
/**
* Controller class for aggregators items.
*
* This extends the Drupal\Core\Entity\
ContentEntityDatabaseStorage class,
*
adding
required special handling for feed item entities.
* This extends the Drupal\Core\Entity\
Sql\SqlContentEntityStorage class, adding
* required special handling for feed item entities.
*/
class
ItemStorage
extends
ContentEntityDatabase
Storage
implements
ItemStorageInterface
{
class
ItemStorage
extends
SqlContentEntity
Storage
implements
ItemStorageInterface
{
/**
* {@inheritdoc}
...
...
core/modules/aggregator/src/ItemStorageSchema.php
View file @
71d24791
...
...
@@ -8,7 +8,7 @@
namespace
Drupal\aggregator
;
use
Drupal\Core\Entity\ContentEntityTypeInterface
;
use
Drupal\Core\Entity\S
chema
\SqlContentEntityStorageSchema
;
use
Drupal\Core\Entity\S
ql
\SqlContentEntityStorageSchema
;
/**
* Defines the item schema handler.
...
...
core/modules/block_content/src/BlockContentStorageSchema.php
View file @
71d24791
...
...
@@ -8,7 +8,7 @@
namespace
Drupal\block_content
;
use
Drupal\Core\Entity\ContentEntityTypeInterface
;
use
Drupal\Core\Entity\S
chema
\SqlContentEntityStorageSchema
;
use
Drupal\Core\Entity\S
ql
\SqlContentEntityStorageSchema
;
/**
* Defines the block content schema handler.
...
...
core/modules/block_content/src/Entity/BlockContent.php
View file @
71d24791
...
...
@@ -21,7 +21,7 @@
* label = @Translation("Custom Block"),
* bundle_label = @Translation("Custom Block type"),
* handlers = {
* "storage" = "Drupal\Core\Entity\
ContentEntityDatabase
Storage",
* "storage" = "Drupal\Core\Entity\
Sql\SqlContentEntity
Storage",
* "storage_schema" = "Drupal\block_content\BlockContentStorageSchema",
* "access" = "Drupal\block_content\BlockContentAccessControlHandler",
* "list_builder" = "Drupal\block_content\BlockContentListBuilder",
...
...
core/modules/comment/src/CommentStorage.php
View file @
71d24791
...
...
@@ -9,21 +9,21 @@
use
Drupal\Core\Cache\CacheBackendInterface
;
use
Drupal\Core\Database\Connection
;
use
Drupal\Core\Entity\ContentEntityDatabaseStorage
;
use
Drupal\Core\Entity\ContentEntityInterface
;
use
Drupal\Core\Entity\EntityInterface
;
use
Drupal\Core\Entity\EntityManagerInterface
;
use
Drupal\Core\Entity\EntityTypeInterface
;
use
Drupal\Core\Entity\Sql\SqlContentEntityStorage
;
use
Drupal\Core\Session\AccountInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
/**
* Defines the controller class for comments.
*
* This extends the Drupal\Core\Entity\
ContentEntityDatabase
Storage class,
* This extends the Drupal\Core\Entity\
Sql\SqlContentEntity
Storage class,
* adding required special handling for comment entities.
*/
class
CommentStorage
extends
ContentEntityDatabase
Storage
implements
CommentStorageInterface
{
class
CommentStorage
extends
SqlContentEntity
Storage
implements
CommentStorageInterface
{
/**
* The current user.
...
...
core/modules/comment/src/CommentStorageSchema.php
View file @
71d24791
...
...
@@ -8,7 +8,7 @@
namespace
Drupal\comment
;
use
Drupal\Core\Entity\ContentEntityTypeInterface
;
use
Drupal\Core\Entity\S
chema
\SqlContentEntityStorageSchema
;
use
Drupal\Core\Entity\S
ql
\SqlContentEntityStorageSchema
;
/**
* Defines the comment schema handler.
...
...
core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.module
View file @
71d24791
...
...
@@ -18,7 +18,7 @@ function contact_storage_test_entity_base_field_info(\Drupal\Core\Entity\EntityT
->
setDescription
(
t
(
'The message ID.'
))
->
setReadOnly
(
TRUE
)
// Explicitly set this to 'contact' so that
//
ContentEntityDatabase
Storage::usesDedicatedTable() doesn't attempt to
//
SqlContentEntity
Storage::usesDedicatedTable() doesn't attempt to
// put the ID in a dedicated table.
// @todo Remove when https://www.drupal.org/node/1498720 is in.
->
setProvider
(
'contact'
)
...
...
@@ -36,7 +36,7 @@ function contact_storage_test_entity_type_alter(array &$entity_types) {
/** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
// Set the controller class for nodes to an alternate implementation of the
// Drupal\Core\Entity\EntityStorageInterface interface.
$entity_types
[
'contact_message'
]
->
setStorageClass
(
'\Drupal\Core\Entity\
ContentEntityDatabase
Storage'
);
$entity_types
[
'contact_message'
]
->
setStorageClass
(
'\Drupal\Core\Entity\
Sql\SqlContentEntity
Storage'
);
$keys
=
$entity_types
[
'contact_message'
]
->
getKeys
();
$keys
[
'id'
]
=
'id'
;
$entity_types
[
'contact_message'
]
->
set
(
'entity_keys'
,
$keys
);
...
...
core/modules/content_translation/src/Tests/ContentTranslationTestBase.php
View file @
71d24791
...
...
@@ -7,7 +7,7 @@
namespace
Drupal\content_translation\Tests
;
use
Drupal\Core\Entity\
ContentEntityDatabase
Storage
;
use
Drupal\Core\Entity\
Sql\SqlContentEntity
Storage
;
use
Drupal\Core\Language\Language
;
use
Drupal\simpletest\WebTestBase
;
...
...
@@ -222,7 +222,7 @@ protected function createEntity($values, $langcode, $bundle_name = NULL) {
$entity_values
[
$bundle_key
]
=
$bundle_name
?:
$this
->
bundle
;
}
$controller
=
$this
->
container
->
get
(
'entity.manager'
)
->
getStorage
(
$this
->
entityTypeId
);
if
(
!
(
$controller
instanceof
ContentEntityDatabase
Storage
))
{
if
(
!
(
$controller
instanceof
SqlContentEntity
Storage
))
{
foreach
(
$values
as
$property
=>
$value
)
{
if
(
is_array
(
$value
))
{
$entity_values
[
$property
]
=
array
(
$langcode
=>
$value
);
...
...
core/modules/field/field.views.inc
View file @
71d24791
...
...
@@ -6,7 +6,7 @@
*/
use
Drupal\Component\Utility\NestedArray
;
use
Drupal\Core\Entity\
ContentEntityDatabase
Storage
;
use
Drupal\Core\Entity\
Sql\SqlContentEntity
Storage
;
use
Drupal\Core\Entity\EntityStorageInterface
;
use
Drupal\field\FieldStorageConfigInterface
;
use
Drupal\field\FieldInstanceConfigInterface
;
...
...
@@ -63,7 +63,7 @@ function field_views_data_alter(&$data) {
* @param \Drupal\field\FieldStorageConfigInterface $field_storage
* The field storage definition.
*
* @return \Drupal\Core\Entity\
ContentEntityDatabase
Storage
* @return \Drupal\Core\Entity\
Sql\SqlContentEntity
Storage
* Returns the entity type storage if supported.
*/
function
_field_views_get_entity_type_storage
(
FieldStorageConfigInterface
$field_storage
)
{
...
...
@@ -71,7 +71,7 @@ function _field_views_get_entity_type_storage(FieldStorageConfigInterface $field
$entity_manager
=
\
Drupal
::
entityManager
();
if
(
$entity_manager
->
hasDefinition
(
$field_storage
->
getTargetEntityTypeId
()))
{
$storage
=
$entity_manager
->
getStorage
(
$field_storage
->
getTargetEntityTypeId
());
$result
=
$storage
instanceof
ContentEntityDatabase
Storage
?
$storage
:
FALSE
;
$result
=
$storage
instanceof
SqlContentEntity
Storage
?
$storage
:
FALSE
;
}
return
$result
;
}
...
...
core/modules/field/src/Tests/FieldAttachOtherTest.php
View file @
71d24791
...
...
@@ -160,7 +160,7 @@ function testEntityDisplayViewMultiple() {
* Test entity cache.
*
* Complements unit test coverage in
* \Drupal\Tests\Core\Entity\
ContentEntityDatabase
StorageTest.
* \Drupal\Tests\Core\Entity\
Sql\SqlContentEntity
StorageTest.
*/
function
testEntityCache
()
{
// Initialize random values and a test entity.
...
...
core/modules/field/src/Tests/FieldDataCountTest.php
View file @
71d24791
...
...
@@ -7,7 +7,7 @@
namespace
Drupal\field\Tests
;
use
Drupal\Core\Entity\
ContentEntityDatabase
Storage
;
use
Drupal\Core\Entity\
Sql\SqlContentEntity
Storage
;
/**
* Tests counting field data records and the hasData() method on
...
...
@@ -74,7 +74,7 @@ public function testEntityCountAndHasData() {
}
$storage
=
\
Drupal
::
entityManager
()
->
getStorage
(
'entity_test'
);
if
(
$storage
instanceof
ContentEntityDatabase
Storage
)
{
if
(
$storage
instanceof
SqlContentEntity
Storage
)
{
// Count the actual number of rows in the field table.
$table_mapping
=
$storage
->
getTableMapping
();
$field_table_name
=
$table_mapping
->
getDedicatedDataTableName
(
$field_storage
);
...
...
core/modules/file/src/FileStorage.php
View file @
71d24791
...
...
@@ -7,12 +7,12 @@
namespace
Drupal\file
;
use
Drupal\Core\Entity\
ContentEntityDatabase
Storage
;
use
Drupal\Core\Entity\
Sql\SqlContentEntity
Storage
;
/**
* File storage for files.
*/
class
FileStorage
extends
ContentEntityDatabase
Storage
implements
FileStorageInterface
{
class
FileStorage
extends
SqlContentEntity
Storage
implements
FileStorageInterface
{
/**
* {@inheritdoc}
...
...
core/modules/file/src/FileStorageSchema.php
View file @
71d24791
...
...
@@ -8,7 +8,7 @@
namespace
Drupal\file
;
use
Drupal\Core\Entity\ContentEntityTypeInterface
;
use
Drupal\Core\Entity\S
chema
\SqlContentEntityStorageSchema
;
use
Drupal\Core\Entity\S
ql
\SqlContentEntityStorageSchema
;
/**
* Defines the file schema handler.
...
...
core/modules/menu_link_content/src/Entity/MenuLinkContent.php
View file @
71d24791
...
...
@@ -21,7 +21,7 @@
* id = "menu_link_content",
* label = @Translation("Custom menu link"),
* handlers = {
* "storage" = "Drupal\Core\Entity\
ContentEntityDatabase
Storage",
* "storage" = "Drupal\Core\Entity\
Sql\SqlContentEntity
Storage",
* "access" = "Drupal\menu_link_content\MenuLinkContentAccessControlHandler",
* "form" = {
* "default" = "Drupal\menu_link_content\Form\MenuLinkContentForm",
...
...
core/modules/node/src/NodeStorage.php
View file @
71d24791
...
...
@@ -7,7 +7,7 @@
namespace
Drupal\node
;
use
Drupal\Core\Entity\
ContentEntityDatabase
Storage
;
use
Drupal\Core\Entity\
Sql\SqlContentEntity
Storage
;
use
Drupal\Core\Session\AccountInterface
;
use
Drupal\Core\Language\LanguageInterface
;
...
...
@@ -17,7 +17,7 @@
* This extends the base storage class, adding required special handling for
* node entities.
*/
class
NodeStorage
extends
ContentEntityDatabase
Storage
implements
NodeStorageInterface
{
class
NodeStorage
extends
SqlContentEntity
Storage
implements
NodeStorageInterface
{
/**
* {@inheritdoc}
...
...
core/modules/node/src/NodeStorageSchema.php
View file @
71d24791
...
...
@@ -8,7 +8,7 @@
namespace
Drupal\node
;
use
Drupal\Core\Entity\ContentEntityTypeInterface
;
use
Drupal\Core\Entity\S
chema
\SqlContentEntityStorageSchema
;
use
Drupal\Core\Entity\S
ql
\SqlContentEntityStorageSchema
;
/**
* Defines the node schema handler.
...
...
core/modules/system/entity.api.php
View file @
71d24791
...
...
@@ -19,7 +19,7 @@
* entity storage classes; see the
* @link entity_api Entity API topic @endlink for more information. Most
* entities use or extend the default classes:
* \Drupal\Core\Entity\
ContentEntityDatabase
Storage for content entities, and
* \Drupal\Core\Entity\
Sql\SqlContentEntity
Storage for content entities, and
* \Drupal\Core\Config\Entity\ConfigEntityStorage for configuration entities.
* For these entities, there is a set of hooks that is invoked for each
* CRUD operation, which module developers can implement to affect these
...
...
@@ -306,7 +306,7 @@
* checkAccess() and checkCreateAccess() methods, not access().
* - storage: A class implementing
* \Drupal\Core\Entity\EntityStorageInterface. If not specified, content
* entities will use \Drupal\Core\Entity\
ContentEntityDatabase
Storage, and
* entities will use \Drupal\Core\Entity\
Sql\SqlContentEntity
Storage, and
* config entities will use \Drupal\Core\Config\Entity\ConfigEntityStorage.
* You can extend one of these classes to provide custom behavior.
* - views_data: A class implementing \Drupal\views\EntityViewsDataInterface
...
...
core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php
View file @
71d24791
...
...
@@ -8,7 +8,7 @@
namespace
Drupal\system\Tests\Entity
;
use
Drupal\Core\Database\Database
;
use
Drupal\Core\Entity\
ContentEntityDatabase
Storage
;
use
Drupal\Core\Entity\
Sql\SqlContentEntity
Storage
;
use
Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException
;
use
Drupal\field\Entity\FieldStorageConfig
;
...
...
@@ -466,7 +466,7 @@ function testFieldSqlStorageForeignKeys() {
$this
->
assertEqual
(
$schema
[
'foreign keys'
][
$foreign_key_name
][
'columns'
][
$foreign_key_name
],
'id'
,
'Foreign key column name modified after update'
);
// Verify the SQL schema.
$schemas
=
ContentEntityDatabase
Storage
::
_fieldSqlSchema
(
$field_storage
);
$schemas
=
SqlContentEntity
Storage
::
_fieldSqlSchema
(
$field_storage
);
$schema
=
$schemas
[
$this
->
table_mapping
->
getDedicatedDataTableName
(
$field_storage
)];
$this
->
assertEqual
(
count
(
$schema
[
'foreign keys'
]),
1
,
'There is 1 foreign key in the schema'
);
$foreign_key
=
reset
(
$schema
[
'foreign keys'
]);
...
...
core/modules/taxonomy/src/TermStorage.php
View file @
71d24791
...
...
@@ -7,14 +7,14 @@
namespace
Drupal\taxonomy
;
use
Drupal\Core\Entity\
ContentEntityDatabase
Storage
;
use
Drupal\Core\Entity\
Sql\SqlContentEntity
Storage
;
use
Drupal\Core\Entity\EntityInterface
;
use
Drupal\Core\Entity\Query\QueryInterface
;
/**
* Defines a Controller class for taxonomy terms.
*/
class
TermStorage
extends
ContentEntityDatabase
Storage
implements
TermStorageInterface
{
class
TermStorage
extends
SqlContentEntity
Storage
implements
TermStorageInterface
{
/**
* {@inheritdoc}
...
...
core/modules/taxonomy/src/TermStorageSchema.php
View file @
71d24791
...
...
@@ -8,7 +8,7 @@
namespace
Drupal\taxonomy
;
use
Drupal\Core\Entity\ContentEntityTypeInterface
;
use
Drupal\Core\Entity\S
chema
\SqlContentEntityStorageSchema
;
use
Drupal\Core\Entity\S
ql
\SqlContentEntityStorageSchema
;
/**
* Defines the term schema handler.
...
...
core/modules/taxonomy/taxonomy.module
View file @
71d24791
...
...
@@ -6,7 +6,7 @@
*/
use
Drupal\Component\Utility\Tags
;
use
Drupal\Core\Entity\
ContentEntityDatabase
Storage
;
use
Drupal\Core\Entity\
Sql\SqlContentEntity
Storage
;
use
Drupal\Core\Entity\EntityInterface
;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\Core\Render\Element
;
...
...
@@ -756,7 +756,7 @@ function taxonomy_node_insert(EntityInterface $node) {
function
taxonomy_build_node_index
(
$node
)
{
// We maintain a denormalized table of term/node relationships, containing
// only data for current, published nodes.
if
(
!
\
Drupal
::
config
(
'taxonomy.settings'
)
->
get
(
'maintain_index_table'
)
||
!
(
\
Drupal
::
entityManager
()
->
getStorage
(
'node'
)
instanceof
ContentEntityDatabase
Storage
))
{
if
(
!
\
Drupal
::
config
(
'taxonomy.settings'
)
->
get
(
'maintain_index_table'
)
||
!
(
\
Drupal
::
entityManager
()
->
getStorage
(
'node'
)
instanceof
SqlContentEntity
Storage
))
{
return
;
}
...
...
core/modules/user/src/UserStorage.php
View file @
71d24791
...
...
@@ -8,11 +8,11 @@
namespace
Drupal\user
;
use
Drupal\Core\Database\Connection
;
use
Drupal\Core\Entity\ContentEntityDatabaseStorage
;
use
Drupal\Core\Cache\CacheBackendInterface
;
use
Drupal\Core\Entity\EntityInterface
;
use
Drupal\Core\Entity\EntityManagerInterface
;
use
Drupal\Core\Entity\EntityTypeInterface
;
use
Drupal\Core\Entity\Sql\SqlContentEntityStorage
;
use
Drupal\Core\Password\PasswordInterface
;
use
Drupal\Core\Session\AccountInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
...
...
@@ -20,10 +20,10 @@
/**
* Controller class for users.
*
* This extends the Drupal\Core\Entity\
ContentEntityDatabase
Storage class,
* This extends the Drupal\Core\Entity\
Sql\SqlContentEntity
Storage class,
* adding required special handling for user objects.
*/
class
UserStorage
extends
ContentEntityDatabase
Storage
implements
UserStorageInterface
{
class
UserStorage
extends
SqlContentEntity
Storage
implements
UserStorageInterface
{
/**
* Provides the password hashing service object.
...
...
core/modules/user/src/UserStorageSchema.php
View file @
71d24791
...
...
@@ -8,7 +8,7 @@
namespace
Drupal\user
;