Issue #1760786 by sun: Move entity system 'back' into a Drupal\Core component.
parent
f91e543aaa
commit
f556c0b023
|
@ -2099,9 +2099,9 @@ function _format_date_callback(array $matches = NULL, $new_langcode = NULL) {
|
|||
* Defaults to empty string when clean URLs are in effect, and to
|
||||
* 'index.php/' when they are not.
|
||||
* - 'entity_type': The entity type of the object that called url(). Only
|
||||
* set if url() is invoked by Drupal\entity\Entity::uri().
|
||||
* set if url() is invoked by Drupal\Core\Entity\Entity::uri().
|
||||
* - 'entity': The entity object (such as a node) for which the URL is being
|
||||
* generated. Only set if url() is invoked by Drupal\entity\Entity::uri().
|
||||
* generated. Only set if url() is invoked by Drupal\Core\Entity\Entity::uri().
|
||||
*
|
||||
* @return
|
||||
* A string containing a URL to the given path.
|
||||
|
@ -4871,6 +4871,7 @@ function _drupal_bootstrap_code() {
|
|||
require_once DRUPAL_ROOT . '/core/includes/token.inc';
|
||||
require_once DRUPAL_ROOT . '/core/includes/errors.inc';
|
||||
require_once DRUPAL_ROOT . '/core/includes/schema.inc';
|
||||
require_once DRUPAL_ROOT . '/core/includes/entity.inc';
|
||||
|
||||
// Load all enabled modules
|
||||
module_load_all();
|
||||
|
|
|
@ -22,11 +22,11 @@
|
|||
* properties of those types that the system needs to know about:
|
||||
* - label: The human-readable name of the type.
|
||||
* - entity class: The name of the entity class, defaults to
|
||||
* Drupal\entity\Entity. The entity class must implement EntityInterface.
|
||||
* Drupal\Core\Entity\Entity. The entity class must implement EntityInterface.
|
||||
* - controller class: The name of the class that is used to load the objects.
|
||||
* The class has to implement the
|
||||
* Drupal\entity\EntityStorageControllerInterface interface. Leave blank
|
||||
* to use the Drupal\entity\DatabaseStorageController implementation.
|
||||
* Drupal\Core\Entity\EntityStorageControllerInterface interface. Leave blank
|
||||
* to use the Drupal\Core\Entity\DatabaseStorageController implementation.
|
||||
* - form controller class: An associative array where the keys are the names
|
||||
* of the different form operations (such as creation, editing or deletion)
|
||||
* and the values are the names of the controller classes. To facilitate
|
||||
|
@ -34,9 +34,9 @@
|
|||
* different operations, the name of the operation is passed also to the
|
||||
* constructor of the form controller class. This way, one class can be used
|
||||
* for multiple entity forms.
|
||||
* - base table: (used by Drupal\entity\DatabaseStorageController) The
|
||||
* - base table: (used by Drupal\Core\Entity\DatabaseStorageController) The
|
||||
* name of the entity type's base table.
|
||||
* - static cache: (used by Drupal\entity\DatabaseStorageController)
|
||||
* - static cache: (used by Drupal\Core\Entity\DatabaseStorageController)
|
||||
* FALSE to disable static caching of entities during a page request.
|
||||
* Defaults to TRUE.
|
||||
* - field cache: (used by Field API loading and saving of field data) FALSE
|
||||
|
@ -57,7 +57,7 @@
|
|||
* (see below). If more complex logic is needed to determine the label of
|
||||
* an entity, you can instead specify a callback function here, which will
|
||||
* be called to determine the entity label. See also the
|
||||
* Drupal\entity\Entity::label() method, which implements this logic.
|
||||
* Drupal\Core\Entity\Entity::label() method, which implements this logic.
|
||||
* - fieldable: Set to TRUE if you want your entity type to be fieldable.
|
||||
* - translation: An associative array of modules registered as field
|
||||
* translation handlers. Array keys are the module names, array values
|
||||
|
@ -229,7 +229,7 @@ function hook_entity_info() {
|
|||
*/
|
||||
function hook_entity_info_alter(&$entity_info) {
|
||||
// Set the controller class for nodes to an alternate implementation of the
|
||||
// Drupal\entity\EntityStorageControllerInterface interface.
|
||||
// Drupal\Core\Entity\EntityStorageControllerInterface interface.
|
||||
$entity_info['node']['controller class'] = 'Drupal\mymodule\MyCustomNodeStorageController';
|
||||
}
|
||||
|
||||
|
@ -253,20 +253,20 @@ function hook_entity_load($entities, $entity_type) {
|
|||
/**
|
||||
* Act on an entity before it is about to be created or updated.
|
||||
*
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity object.
|
||||
*/
|
||||
function hook_entity_presave(Drupal\entity\EntityInterface $entity) {
|
||||
function hook_entity_presave(Drupal\Core\Entity\EntityInterface $entity) {
|
||||
$entity->changed = REQUEST_TIME;
|
||||
}
|
||||
|
||||
/**
|
||||
* Act on entities when inserted.
|
||||
*
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity object.
|
||||
*/
|
||||
function hook_entity_insert(Drupal\entity\EntityInterface $entity) {
|
||||
function hook_entity_insert(Drupal\Core\Entity\EntityInterface $entity) {
|
||||
// Insert the new entity into a fictional table of all entities.
|
||||
db_insert('example_entity')
|
||||
->fields(array(
|
||||
|
@ -281,10 +281,10 @@ function hook_entity_insert(Drupal\entity\EntityInterface $entity) {
|
|||
/**
|
||||
* Act on entities when updated.
|
||||
*
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity object.
|
||||
*/
|
||||
function hook_entity_update(Drupal\entity\EntityInterface $entity) {
|
||||
function hook_entity_update(Drupal\Core\Entity\EntityInterface $entity) {
|
||||
// Update the entity's entry in a fictional table of all entities.
|
||||
db_update('example_entity')
|
||||
->fields(array(
|
||||
|
@ -300,10 +300,10 @@ function hook_entity_update(Drupal\entity\EntityInterface $entity) {
|
|||
*
|
||||
* This hook runs after the entity type-specific predelete hook.
|
||||
*
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity object for the entity that is about to be deleted.
|
||||
*/
|
||||
function hook_entity_predelete(Drupal\entity\EntityInterface $entity) {
|
||||
function hook_entity_predelete(Drupal\Core\Entity\EntityInterface $entity) {
|
||||
// Count references to this entity in a custom table before they are removed
|
||||
// upon entity deletion.
|
||||
$id = $entity->id();
|
||||
|
@ -329,10 +329,10 @@ function hook_entity_predelete(Drupal\entity\EntityInterface $entity) {
|
|||
*
|
||||
* This hook runs after the entity type-specific delete hook.
|
||||
*
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity object for the entity that has been deleted.
|
||||
*/
|
||||
function hook_entity_delete(Drupal\entity\EntityInterface $entity) {
|
||||
function hook_entity_delete(Drupal\Core\Entity\EntityInterface $entity) {
|
||||
// Delete the entity's entry from a fictional table of all entities.
|
||||
db_delete('example_entity')
|
||||
->condition('type', $entity->entityType())
|
||||
|
@ -341,9 +341,9 @@ function hook_entity_delete(Drupal\entity\EntityInterface $entity) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Alter or execute an Drupal\entity\EntityFieldQuery.
|
||||
* Alter or execute an Drupal\Core\Entity\EntityFieldQuery.
|
||||
*
|
||||
* @param Drupal\entity\EntityFieldQuery $query
|
||||
* @param Drupal\Core\Entity\EntityFieldQuery $query
|
||||
* An EntityFieldQuery. One of the most important properties to be changed is
|
||||
* EntityFieldQuery::executeCallback. If this is set to an existing function,
|
||||
* this function will get the query as its single argument and its result
|
||||
|
@ -362,14 +362,14 @@ function hook_entity_delete(Drupal\entity\EntityInterface $entity) {
|
|||
* ($query->pager && $query->count), allowing the driver to return 0 from
|
||||
* the count query and disable the pager.
|
||||
*/
|
||||
function hook_entity_query_alter(Drupal\entity\EntityFieldQuery $query) {
|
||||
function hook_entity_query_alter(Drupal\Core\Entity\EntityFieldQuery $query) {
|
||||
$query->executeCallback = 'my_module_query_callback';
|
||||
}
|
||||
|
||||
/**
|
||||
* Act on entities being assembled before rendering.
|
||||
*
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity object.
|
||||
* @param $view_mode
|
||||
* The view mode the entity is rendered in.
|
||||
|
@ -385,7 +385,7 @@ function hook_entity_query_alter(Drupal\entity\EntityFieldQuery $query) {
|
|||
* @see hook_node_view()
|
||||
* @see hook_user_view()
|
||||
*/
|
||||
function hook_entity_view(Drupal\entity\EntityInterface $entity, $view_mode, $langcode) {
|
||||
function hook_entity_view(Drupal\Core\Entity\EntityInterface $entity, $view_mode, $langcode) {
|
||||
$entity->content['my_additional_field'] = array(
|
||||
'#markup' => $additional_field,
|
||||
'#weight' => 10,
|
||||
|
@ -408,7 +408,7 @@ function hook_entity_view(Drupal\entity\EntityInterface $entity, $view_mode, $la
|
|||
*
|
||||
* @param $build
|
||||
* A renderable array representing the entity content.
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity object being rendered.
|
||||
*
|
||||
* @see hook_entity_view()
|
||||
|
@ -417,7 +417,7 @@ function hook_entity_view(Drupal\entity\EntityInterface $entity, $view_mode, $la
|
|||
* @see hook_taxonomy_term_view_alter()
|
||||
* @see hook_user_view_alter()
|
||||
*/
|
||||
function hook_entity_view_alter(&$build, Drupal\entity\EntityInterface $entity) {
|
||||
function hook_entity_view_alter(&$build, Drupal\Core\Entity\EntityInterface $entity) {
|
||||
if ($build['#view_mode'] == 'full' && isset($build['an_additional_field'])) {
|
||||
// Change its weight.
|
||||
$build['an_additional_field']['#weight'] = -10;
|
||||
|
@ -454,13 +454,13 @@ function hook_entity_prepare_view($entities, $entity_type) {
|
|||
*
|
||||
* @param string $view_mode
|
||||
* The view_mode that is to be used to display the entity.
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity that is being viewed.
|
||||
* @param array $context
|
||||
* Array with additional context information, currently only contains the
|
||||
* langcode the entity is viewed in.
|
||||
*/
|
||||
function hook_entity_view_mode_alter(&$view_mode, Drupal\entity\EntityInterface $entity, $context) {
|
||||
function hook_entity_view_mode_alter(&$view_mode, Drupal\Core\Entity\EntityInterface $entity, $context) {
|
||||
// For nodes, change the view mode when it is teaser.
|
||||
if ($entity->entityType() == 'node' && $view_mode == 'teaser') {
|
||||
$view_mode = 'my_custom_view_mode';
|
|
@ -6,37 +6,10 @@
|
|||
*/
|
||||
|
||||
use \InvalidArgumentException;
|
||||
use Drupal\entity\EntityFieldQuery;
|
||||
use Drupal\entity\EntityMalformedException;
|
||||
use Drupal\entity\EntityStorageException;
|
||||
use Drupal\entity\EntityInterface;
|
||||
|
||||
/**
|
||||
* Implements hook_help().
|
||||
*/
|
||||
function entity_help($path, $arg) {
|
||||
switch ($path) {
|
||||
case 'admin/help#entity':
|
||||
$output = '';
|
||||
$output .= '<h3>' . t('About') . '</h3>';
|
||||
$output .= '<p>' . t('The Entity module provides an API for managing entities like nodes and users, i.e. an API for loading and identifying entities. For more information, see the online handbook entry for <a href="!url">Entity module</a>', array('!url' => 'http://drupal.org/documentation/modules/entity')) . '</p>';
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_modules_preenable().
|
||||
*/
|
||||
function entity_modules_preenable() {
|
||||
entity_info_cache_clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_modules_disabled().
|
||||
*/
|
||||
function entity_modules_disabled() {
|
||||
entity_info_cache_clear();
|
||||
}
|
||||
use Drupal\Core\Entity\EntityFieldQuery;
|
||||
use Drupal\Core\Entity\EntityMalformedException;
|
||||
use Drupal\Core\Entity\EntityStorageException;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
|
||||
/**
|
||||
* Gets the entity info array of an entity type.
|
||||
|
@ -72,10 +45,10 @@ function entity_get_info($entity_type = NULL) {
|
|||
foreach ($entity_info as $name => $data) {
|
||||
$entity_info[$name] += array(
|
||||
'fieldable' => FALSE,
|
||||
'entity class' => 'Drupal\entity\Entity',
|
||||
'controller class' => 'Drupal\entity\DatabaseStorageController',
|
||||
'entity class' => 'Drupal\Core\Entity\Entity',
|
||||
'controller class' => 'Drupal\Core\Entity\DatabaseStorageController',
|
||||
'form controller class' => array(
|
||||
'default' => 'Drupal\entity\EntityFormController',
|
||||
'default' => 'Drupal\Core\Entity\EntityFormController',
|
||||
),
|
||||
'static cache' => TRUE,
|
||||
'field cache' => TRUE,
|
||||
|
@ -99,7 +72,7 @@ function entity_get_info($entity_type = NULL) {
|
|||
$entity_info[$name]['bundles'] = array($name => array('label' => $entity_info[$name]['label']));
|
||||
}
|
||||
// Prepare entity schema fields SQL info for
|
||||
// Drupal\entity\DatabaseStorageControllerInterface::buildQuery().
|
||||
// Drupal\Core\Entity\DatabaseStorageControllerInterface::buildQuery().
|
||||
if (isset($entity_info[$name]['base table'])) {
|
||||
$entity_info[$name]['schema_fields_sql']['base table'] = drupal_schema_fields_sql($entity_info[$name]['base table']);
|
||||
if (isset($entity_info[$name]['revision table'])) {
|
||||
|
@ -140,14 +113,14 @@ function entity_info_cache_clear() {
|
|||
* @param bool $reset
|
||||
* Whether to reset the internal cache for the requested entity type.
|
||||
*
|
||||
* @return Drupal\entity\EntityInterface
|
||||
* @return Drupal\Core\Entity\EntityInterface
|
||||
* The entity object, or FALSE if there is no entity with the given id.
|
||||
*
|
||||
* @see hook_entity_info()
|
||||
* @see entity_load_multiple()
|
||||
* @see Drupal\entity\EntityStorageControllerInterface
|
||||
* @see Drupal\entity\DatabaseStorageController
|
||||
* @see Drupal\entity\EntityFieldQuery
|
||||
* @see Drupal\Core\Entity\EntityStorageControllerInterface
|
||||
* @see Drupal\Core\Entity\DatabaseStorageController
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery
|
||||
*/
|
||||
function entity_load($entity_type, $id, $reset = FALSE) {
|
||||
$entities = entity_load_multiple($entity_type, array($id), $reset);
|
||||
|
@ -162,13 +135,13 @@ function entity_load($entity_type, $id, $reset = FALSE) {
|
|||
* @param int $revision_id
|
||||
* The id of the entity to load.
|
||||
*
|
||||
* @return Drupal\entity\EntityInterface
|
||||
* @return Drupal\Core\Entity\EntityInterface
|
||||
* The entity object, or FALSE if there is no entity with the given revision
|
||||
* id.
|
||||
*
|
||||
* @see hook_entity_info()
|
||||
* @see Drupal\entity\EntityStorageControllerInterface
|
||||
* @see Drupal\entity\DatabaseStorageController
|
||||
* @see Drupal\Core\Entity\EntityStorageControllerInterface
|
||||
* @see Drupal\Core\Entity\DatabaseStorageController
|
||||
*/
|
||||
function entity_revision_load($entity_type, $revision_id) {
|
||||
return entity_get_controller($entity_type)->loadRevision($revision_id);
|
||||
|
@ -189,7 +162,7 @@ function entity_revision_load($entity_type, $revision_id) {
|
|||
* @return EntityInterface|FALSE
|
||||
* The entity object, or FALSE if there is no entity with the given UUID.
|
||||
*
|
||||
* @throws Drupal\entity\EntityStorageException
|
||||
* @throws Drupal\Core\Entity\EntityStorageException
|
||||
* Thrown in case the requested entity type does not support UUIDs.
|
||||
*
|
||||
* @see hook_entity_info()
|
||||
|
@ -217,12 +190,12 @@ function entity_load_by_uuid($entity_type, $uuid, $reset = FALSE) {
|
|||
* database access if loaded again during the same page request.
|
||||
*
|
||||
* The actual loading is done through a class that has to implement the
|
||||
* Drupal\entity\EntityStorageControllerInterface interface. By default,
|
||||
* Drupal\entity\DatabaseStorageController is used. Entity types can
|
||||
* Drupal\Core\Entity\EntityStorageControllerInterface interface. By default,
|
||||
* Drupal\Core\Entity\DatabaseStorageController is used. Entity types can
|
||||
* specify that a different class should be used by setting the
|
||||
* 'controller class' key in hook_entity_info(). These classes can either
|
||||
* implement the Drupal\entity\EntityStorageControllerInterface interface, or,
|
||||
* most commonly, extend the Drupal\entity\DatabaseStorageController
|
||||
* implement the Drupal\Core\Entity\EntityStorageControllerInterface interface, or,
|
||||
* most commonly, extend the Drupal\Core\Entity\DatabaseStorageController
|
||||
* class. See node_entity_info() and the NodeStorageController in node.module as
|
||||
* an example.
|
||||
*
|
||||
|
@ -237,9 +210,9 @@ function entity_load_by_uuid($entity_type, $uuid, $reset = FALSE) {
|
|||
* An array of entity objects indexed by their ids.
|
||||
*
|
||||
* @see hook_entity_info()
|
||||
* @see Drupal\entity\EntityStorageControllerInterface
|
||||
* @see Drupal\entity\DatabaseStorageController
|
||||
* @see Drupal\entity\EntityFieldQuery
|
||||
* @see Drupal\Core\Entity\EntityStorageControllerInterface
|
||||
* @see Drupal\Core\Entity\DatabaseStorageController
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery
|
||||
*/
|
||||
function entity_load_multiple($entity_type, array $ids = NULL, $reset = FALSE) {
|
||||
if ($reset) {
|
||||
|
@ -307,7 +280,7 @@ function entity_delete_multiple($entity_type, $ids) {
|
|||
* An array of values to set, keyed by property name. If the entity type has
|
||||
* bundles the bundle key has to be specified.
|
||||
*
|
||||
* @return Drupal\entity\EntityInterface
|
||||
* @return Drupal\Core\Entity\EntityInterface
|
||||
* A new entity object.
|
||||
*/
|
||||
function entity_create($entity_type, array $values) {
|
||||
|
@ -317,7 +290,7 @@ function entity_create($entity_type, array $values) {
|
|||
/**
|
||||
* Gets the entity controller class for an entity type.
|
||||
*
|
||||
* @return Drupal\entity\EntityStorageControllerInterface
|
||||
* @return Drupal\Core\Entity\EntityStorageControllerInterface
|
||||
*/
|
||||
function entity_get_controller($entity_type) {
|
||||
$controllers = &drupal_static(__FUNCTION__, array());
|
||||
|
@ -373,10 +346,10 @@ function entity_prepare_view($entity_type, $entities) {
|
|||
/**
|
||||
* Returns the label of an entity.
|
||||
*
|
||||
* This is a wrapper for Drupal\entity\EntityInterface::label(). This function
|
||||
* This is a wrapper for Drupal\Core\Entity\EntityInterface::label(). This function
|
||||
* should only be used as a callback, e.g. for menu title callbacks.
|
||||
*
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity for which to generate the label.
|
||||
* @param $langcode
|
||||
* (optional) The language code of the language that should be used for
|
||||
|
@ -386,7 +359,7 @@ function entity_prepare_view($entity_type, $entities) {
|
|||
* @return
|
||||
* The label of the entity, or NULL if there is no label defined.
|
||||
*
|
||||
* @see Drupal\entity\EntityInterface::label()
|
||||
* @see Drupal\Core\Entity\EntityInterface::label()
|
||||
*/
|
||||
function entity_page_label(EntityInterface $entity, $langcode = NULL) {
|
||||
return $entity->label($langcode);
|
||||
|
@ -410,7 +383,7 @@ function entity_page_label(EntityInterface $entity, $langcode = NULL) {
|
|||
* identifying the controlled form. Defaults to 'default' which is the usual
|
||||
* create/edit form.
|
||||
*
|
||||
* @return Drupal\entity\EntityFormControllerInterface
|
||||
* @return Drupal\Core\Entity\EntityFormControllerInterface
|
||||
* An entity form controller instance.
|
||||
*/
|
||||
function entity_form_controller($entity_type, $operation = 'default') {
|
||||
|
@ -422,7 +395,7 @@ function entity_form_controller($entity_type, $operation = 'default') {
|
|||
}
|
||||
// If no controller is specified default to the base implementation.
|
||||
elseif (empty($info['form controller class']) && $operation == 'default') {
|
||||
$class = 'Drupal\entity\EntityFormController';
|
||||
$class = 'Drupal\Core\Entity\EntityFormController';
|
||||
}
|
||||
// If a non-existing operation has been specified stop.
|
||||
else {
|
|
@ -273,6 +273,7 @@ function install_begin_request(&$install_state) {
|
|||
// Load module basics (needed for hook invokes).
|
||||
include_once DRUPAL_ROOT . '/core/includes/module.inc';
|
||||
include_once DRUPAL_ROOT . '/core/includes/session.inc';
|
||||
require_once DRUPAL_ROOT . '/core/includes/entity.inc';
|
||||
|
||||
// Determine whether the configuration system is ready to operate.
|
||||
$install_state['config_verified'] = install_verify_config_directory(CONFIG_ACTIVE_DIRECTORY) && install_verify_config_directory(CONFIG_STAGING_DIRECTORY);
|
||||
|
@ -320,11 +321,9 @@ function install_begin_request(&$install_state) {
|
|||
require_once DRUPAL_ROOT . '/core/includes/ajax.inc';
|
||||
// Override the module list with a minimal set of modules.
|
||||
$module_list['system']['filename'] = 'core/modules/system/system.module';
|
||||
$module_list['entity']['filename'] = 'core/modules/entity/entity.module';
|
||||
$module_list['user']['filename'] = 'core/modules/user/user.module';
|
||||
module_list(NULL, $module_list);
|
||||
drupal_load('module', 'system');
|
||||
drupal_load('module', 'entity');
|
||||
drupal_load('module', 'user');
|
||||
|
||||
// Load the cache infrastructure using a "fake" cache implementation that
|
||||
|
|
|
@ -476,6 +476,7 @@ function module_enable($module_list, $enable_dependencies = TRUE) {
|
|||
}
|
||||
|
||||
// Allow modules to react prior to the enabling of a module.
|
||||
entity_info_cache_clear();
|
||||
module_invoke_all('modules_preenable', array($module));
|
||||
|
||||
// Enable the module.
|
||||
|
@ -560,6 +561,7 @@ function module_disable($module_list, $disable_dependents = TRUE) {
|
|||
// Refresh the module list to exclude the disabled modules.
|
||||
system_list_reset();
|
||||
module_implements_reset();
|
||||
entity_info_cache_clear();
|
||||
// Invoke hook_modules_disabled before disabling modules,
|
||||
// so we can still call module hooks to get information.
|
||||
module_invoke_all('modules_disabled', $invoke_modules);
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\entity\ContentEntityInterface.
|
||||
* Definition of Drupal\Core\Entity\ContentEntityInterface.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity;
|
||||
namespace Drupal\Core\Entity;
|
||||
|
||||
/**
|
||||
* Defines a common interface for all content entity objects.
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\entity\DatabaseStorageController.
|
||||
* Definition of Drupal\Core\Entity\DatabaseStorageController.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity;
|
||||
namespace Drupal\Core\Entity;
|
||||
|
||||
use PDO;
|
||||
use Exception;
|
||||
|
@ -15,7 +15,7 @@ use Drupal\Component\Uuid\Uuid;
|
|||
/**
|
||||
* Defines a base entity controller class.
|
||||
*
|
||||
* Default implementation of Drupal\entity\EntityStorageControllerInterface.
|
||||
* Default implementation of Drupal\Core\Entity\EntityStorageControllerInterface.
|
||||
*
|
||||
* This class can be used as-is by most simple entity types. Entity types
|
||||
* requiring special handling can extend the class.
|
||||
|
@ -48,7 +48,7 @@ class DatabaseStorageController implements EntityStorageControllerInterface {
|
|||
/**
|
||||
* Additional arguments to pass to hook_TYPE_load().
|
||||
*
|
||||
* Set before calling Drupal\entity\DatabaseStorageController::attachLoad().
|
||||
* Set before calling Drupal\Core\Entity\DatabaseStorageController::attachLoad().
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
|
@ -96,7 +96,7 @@ class DatabaseStorageController implements EntityStorageControllerInterface {
|
|||
protected $cache;
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityStorageControllerInterface::__construct().
|
||||
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::__construct().
|
||||
*
|
||||
* Sets basic variables.
|
||||
*/
|
||||
|
@ -129,7 +129,7 @@ class DatabaseStorageController implements EntityStorageControllerInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityStorageControllerInterface::resetCache().
|
||||
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::resetCache().
|
||||
*/
|
||||
public function resetCache(array $ids = NULL) {
|
||||
if (isset($ids)) {
|
||||
|
@ -143,7 +143,7 @@ class DatabaseStorageController implements EntityStorageControllerInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityStorageControllerInterface::load().
|
||||
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::load().
|
||||
*/
|
||||
public function load(array $ids = NULL) {
|
||||
$entities = array();
|
||||
|
@ -174,7 +174,7 @@ class DatabaseStorageController implements EntityStorageControllerInterface {
|
|||
if (!empty($this->entityInfo['entity class'])) {
|
||||
// We provide the necessary arguments for PDO to create objects of the
|
||||
// specified entity class.
|
||||
// @see Drupal\entity\EntityInterface::__construct()
|
||||
// @see Drupal\Core\Entity\EntityInterface::__construct()
|
||||
$query_result->setFetchMode(PDO::FETCH_CLASS, $this->entityInfo['entity class'], array(array(), $this->entityType));
|
||||
}
|
||||
$queried_entities = $query_result->fetchAllAssoc($this->idKey);
|
||||
|
@ -210,7 +210,7 @@ class DatabaseStorageController implements EntityStorageControllerInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityStorageControllerInterface::loadRevision().
|
||||
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::loadRevision().
|
||||
*/
|
||||
public function loadRevision($revision_id) {
|
||||
// Build and execute the query.
|
||||
|
@ -219,7 +219,7 @@ class DatabaseStorageController implements EntityStorageControllerInterface {
|
|||
if (!empty($this->entityInfo['entity class'])) {
|
||||
// We provide the necessary arguments for PDO to create objects of the
|
||||
// specified entity class.
|
||||
// @see Drupal\entity\EntityInterface::__construct()
|
||||
// @see Drupal\Core\Entity\EntityInterface::__construct()
|
||||
$query_result->setFetchMode(PDO::FETCH_CLASS, $this->entityInfo['entity class'], array(array(), $this->entityType));
|
||||
}
|
||||
$queried_entities = $query_result->fetchAllAssoc($this->idKey);
|
||||
|
@ -234,7 +234,7 @@ class DatabaseStorageController implements EntityStorageControllerInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityStorageControllerInterface::loadByProperties().
|
||||
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::loadByProperties().
|
||||
*/
|
||||
public function loadByProperties(array $values = array()) {
|
||||
// Build a query to fetch the entity IDs.
|
||||
|
@ -253,7 +253,7 @@ class DatabaseStorageController implements EntityStorageControllerInterface {
|
|||
/**
|
||||
* Builds an entity query.
|
||||
*
|
||||
* @param Drupal\entity\EntityFieldQuery $entity_query
|
||||
* @param Drupal\Core\Entity\EntityFieldQuery $entity_query
|
||||
* EntityFieldQuery instance.
|
||||
* @param array $values
|
||||
* An associative array of properties of the entity, where the keys are the
|
||||
|
@ -400,10 +400,10 @@ class DatabaseStorageController implements EntityStorageControllerInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityStorageControllerInterface::create().
|
||||
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::create().
|
||||
*/
|
||||
public function create(array $values) {
|
||||
$class = isset($this->entityInfo['entity class']) ? $this->entityInfo['entity class'] : 'Drupal\entity\Entity';
|
||||
$class = isset($this->entityInfo['entity class']) ? $this->entityInfo['entity class'] : 'Drupal\Core\Entity\Entity';
|
||||
|
||||
$entity = new $class($values, $this->entityType);
|
||||
|
||||
|
@ -417,7 +417,7 @@ class DatabaseStorageController implements EntityStorageControllerInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityStorageControllerInterface::delete().
|
||||
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::delete().
|
||||
*/
|
||||
public function delete($ids) {
|
||||
$entities = $ids ? $this->load($ids) : FALSE;
|
||||
|
@ -455,7 +455,7 @@ class DatabaseStorageController implements EntityStorageControllerInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityStorageControllerInterface::save().
|
||||
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::save().
|
||||
*/
|
||||
public function save(EntityInterface $entity) {
|
||||
$transaction = db_transaction();
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\entity\Entity.
|
||||
* Definition of Drupal\Core\Entity\Entity.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity;
|
||||
namespace Drupal\Core\Entity;
|
||||
|
||||
use Drupal\Component\Uuid\Uuid;
|
||||
use Drupal\Core\Language\Language;
|
||||
|
@ -270,14 +270,14 @@ class Entity implements EntityInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityInterface::getRevisionId().
|
||||
* Implements Drupal\Core\Entity\EntityInterface::getRevisionId().
|
||||
*/
|
||||
public function getRevisionId() {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityInterface::isDefaultRevision().
|
||||
* Implements Drupal\Core\Entity\EntityInterface::isDefaultRevision().
|
||||
*/
|
||||
public function isDefaultRevision($new_value = NULL) {
|
||||
$return = $this->isDefaultRevision;
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\entity\EntityFieldQuery.
|
||||
* Definition of Drupal\Core\Entity\EntityFieldQuery.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity;
|
||||
namespace Drupal\Core\Entity;
|
||||
|
||||
use Drupal\entity\EntityFieldQueryException;
|
||||
use Drupal\Core\Entity\EntityFieldQueryException;
|
||||
use Drupal\Core\Database\Query\Select;
|
||||
use Drupal\Core\Database\Query\PagerSelectExtender;
|
||||
|
||||
|
@ -44,7 +44,7 @@ class EntityFieldQuery {
|
|||
/**
|
||||
* Indicates that both deleted and non-deleted fields should be returned.
|
||||
*
|
||||
* @see Drupal\entity\EntityFieldQuery::deleted()
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::deleted()
|
||||
*/
|
||||
const RETURN_ALL = NULL;
|
||||
|
||||
|
@ -63,7 +63,7 @@ class EntityFieldQuery {
|
|||
*
|
||||
* @var array
|
||||
*
|
||||
* @see Drupal\entity\EntityFieldQuery::entityCondition()
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::entityCondition()
|
||||
*/
|
||||
public $entityConditions = array();
|
||||
|
||||
|
@ -72,7 +72,7 @@ class EntityFieldQuery {
|
|||
*
|
||||
* @var array
|
||||
*
|
||||
* @see Drupal\entity\EntityFieldQuery::fieldCondition()
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::fieldCondition()
|
||||
*/
|
||||
public $fieldConditions = array();
|
||||
|
||||
|
@ -86,8 +86,8 @@ class EntityFieldQuery {
|
|||
*
|
||||
* @var array
|
||||
*
|
||||
* @see Drupal\entity\EntityFieldQuery::fieldLanguageCondition()
|
||||
* @see Drupal\entity\EntityFieldQuery::fieldDeltaCondition()
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::fieldLanguageCondition()
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::fieldDeltaCondition()
|
||||
*/
|
||||
public $fieldMetaConditions = array();
|
||||
|
||||
|
@ -96,7 +96,7 @@ class EntityFieldQuery {
|
|||
*
|
||||
* @var array
|
||||
*
|
||||
* @see Drupal\entity\EntityFieldQuery::propertyCondition()
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::propertyCondition()
|
||||
*/
|
||||
public $propertyConditions = array();
|
||||
|
||||
|
@ -112,7 +112,7 @@ class EntityFieldQuery {
|
|||
*
|
||||
* @var array
|
||||
*
|
||||
* @see Drupal\entity\EntityFieldQuery::range()
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::range()
|
||||
*/
|
||||
public $range = array();
|
||||
|
||||
|
@ -121,7 +121,7 @@ class EntityFieldQuery {
|
|||
*
|
||||
* @var array
|
||||
*
|
||||
* @see Drupal\entity\EntityFieldQuery::pager()
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::pager()
|
||||
*/
|
||||
public $pager = array();
|
||||
|
||||
|
@ -131,7 +131,7 @@ class EntityFieldQuery {
|
|||
* TRUE to return only deleted data, FALSE to return only non-deleted data,
|
||||
* EntityFieldQuery::RETURN_ALL to return everything.
|
||||
*
|
||||
* @see Drupal\entity\EntityFieldQuery::deleted()
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::deleted()
|
||||
*/
|
||||
public $deleted = FALSE;
|
||||
|
||||
|
@ -159,7 +159,7 @@ class EntityFieldQuery {
|
|||
*
|
||||
* @var int
|
||||
*
|
||||
* @see Drupal\entity\EntityFieldQuery::age()
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::age()
|
||||
*/
|
||||
public $age = FIELD_LOAD_CURRENT;
|
||||
|
||||
|
@ -168,7 +168,7 @@ class EntityFieldQuery {
|
|||
*
|
||||
* @var array
|
||||
*
|
||||
* @see Drupal\entity\EntityFieldQuery::addTag()
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::addTag()
|
||||
*/
|
||||
public $tags = array();
|
||||
|
||||
|
@ -177,7 +177,7 @@ class EntityFieldQuery {
|
|||
*
|
||||
* @var array
|
||||
*
|
||||
* @see Drupal\entity\EntityFieldQuery::addMetaData()
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::addMetaData()
|
||||
*/
|
||||
public $metaData = array();
|
||||
|
||||
|
@ -186,7 +186,7 @@ class EntityFieldQuery {
|
|||
*
|
||||
* @var array
|
||||
*
|
||||
* @see Drupal\entity\EntityFieldQuery::execute().
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::execute().
|
||||
*/
|
||||
public $orderedResults = array();
|
||||
|
||||
|
@ -195,7 +195,7 @@ class EntityFieldQuery {
|
|||
*
|
||||
* @var string
|
||||
*
|
||||
* @see Drupal\entity\EntityFieldQuery::execute()
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::execute()
|
||||
*/
|
||||
public $executeCallback = '';
|
||||
|
||||
|
@ -233,7 +233,7 @@ class EntityFieldQuery {
|
|||
* The operator can be omitted, and will default to 'IN' if the value is an
|
||||
* array, or to '=' otherwise.
|
||||
*
|
||||
* @return Drupal\entity\EntityFieldQuery
|
||||
* @return Drupal\Core\Entity\EntityFieldQuery
|
||||
* The called object.
|
||||
*/
|
||||
public function entityCondition($name, $value, $operator = NULL) {
|
||||
|
@ -265,11 +265,11 @@ class EntityFieldQuery {
|
|||
* An arbitrary identifier: conditions in the same group must have the same
|
||||
* $langcode_group.
|
||||
*
|
||||
* @return Drupal\entity\EntityFieldQuery
|
||||
* @return Drupal\Core\Entity\EntityFieldQuery
|
||||
* The called object.
|
||||
*
|
||||
* @see Drupal\entity\EntityFieldQuery::addFieldCondition()
|
||||
* @see Drupal\entity\EntityFieldQuery::deleted()
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::addFieldCondition()
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::deleted()
|
||||
*/
|
||||
public function fieldCondition($field, $column = NULL, $value = NULL, $operator = NULL, $delta_group = NULL, $langcode_group = NULL) {
|
||||
return $this->addFieldCondition($this->fieldConditions, $field, $column, $value, $operator, $delta_group, $langcode_group);
|
||||
|
@ -291,11 +291,11 @@ class EntityFieldQuery {
|
|||
* An arbitrary identifier: conditions in the same group must have the same
|
||||
* $langcode_group.
|
||||
*
|
||||
* @return Drupal\entity\EntityFieldQuery
|
||||
* @return Drupal\Core\Entity\EntityFieldQuery
|
||||
* The called object.
|
||||
*
|
||||
* @see Drupal\entity\EntityFieldQuery::addFieldCondition()
|
||||
* @see Drupal\entity\EntityFieldQuery::deleted()
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::addFieldCondition()
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::deleted()
|
||||
*/
|
||||
public function fieldLanguageCondition($field, $value = NULL, $operator = NULL, $delta_group = NULL, $langcode_group = NULL) {
|
||||
return $this->addFieldCondition($this->fieldMetaConditions, $field, 'langcode', $value, $operator, $delta_group, $langcode_group);
|
||||
|
@ -317,11 +317,11 @@ class EntityFieldQuery {
|
|||
* An arbitrary identifier: conditions in the same group must have the same
|
||||
* $langcode_group.
|
||||
*
|
||||
* @return Drupal\entity\EntityFieldQuery
|
||||
* @return Drupal\Core\Entity\EntityFieldQuery
|
||||
* The called object.
|
||||
*
|
||||
* @see Drupal\entity\EntityFieldQuery::addFieldCondition()
|
||||
* @see Drupal\entity\EntityFieldQuery::deleted()
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::addFieldCondition()
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery::deleted()
|
||||
*/
|
||||
public function fieldDeltaCondition($field, $value = NULL, $operator = NULL, $delta_group = NULL, $langcode_group = NULL) {
|
||||
return $this->addFieldCondition($this->fieldMetaConditions, $field, 'delta', $value, $operator, $delta_group, $langcode_group);
|
||||
|
@ -367,7 +367,7 @@ class EntityFieldQuery {
|
|||
* An arbitrary identifier: conditions in the same group must have the same
|
||||
* $langcode_group.
|
||||
*
|
||||
* @return Drupal\entity\EntityFieldQuery
|
||||
* @return Drupal\Core\Entity\EntityFieldQuery
|
||||
* The called object.
|
||||
*/
|
||||
protected function addFieldCondition(&$conditions, $field, $column = NULL, $value = NULL, $operator = NULL, $delta_group = NULL, $langcode_group = NULL) {
|
||||
|
@ -421,7 +421,7 @@ class EntityFieldQuery {
|
|||
* The operator can be omitted, and will default to 'IN' if the value is an
|
||||
* array, or to '=' otherwise.
|
||||
*
|
||||
* @return Drupal\entity\EntityFieldQuery
|
||||
* @return Drupal\Core\Entity\EntityFieldQuery
|
||||
* The called object.
|
||||
*/
|
||||
public function propertyCondition($column, $value, $operator = NULL) {
|
||||
|
@ -447,7 +447,7 @@ class EntityFieldQuery {
|
|||
* @param $direction
|
||||
* The direction to sort. Legal values are "ASC" and "DESC".
|
||||
*
|
||||
* @return Drupal\entity\EntityFieldQuery
|
||||
* @return Drupal\Core\Entity\EntityFieldQuery
|
||||
* The called object.
|
||||
*/
|
||||
public function entityOrderBy($name, $direction = 'ASC') {
|
||||
|
@ -475,7 +475,7 @@ class EntityFieldQuery {
|
|||
* @param $direction
|
||||
* The direction to sort. Legal values are "ASC" and "DESC".
|
||||
*
|
||||
* @return Drupal\entity\EntityFieldQuery
|
||||
* @return Drupal\Core\Entity\EntityFieldQuery
|
||||
* The called object.
|
||||
*/
|
||||
public function fieldOrderBy($field, $column, $direction = 'ASC') {
|
||||
|
@ -516,7 +516,7 @@ class EntityFieldQuery {
|
|||
* @param $direction
|
||||
* The direction to sort. Legal values are "ASC" and "DESC".
|
||||
*
|
||||
* @return Drupal\entity\EntityFieldQuery
|
||||
* @return Drupal\Core\Entity\EntityFieldQuery
|
||||
* The called object.
|
||||
*/
|
||||
public function propertyOrderBy($column, $direction = 'ASC') {
|
||||
|
@ -531,7 +531,7 @@ class EntityFieldQuery {
|
|||
/**
|
||||
* Sets the query to be a count query only.
|
||||
*
|
||||
* @return Drupal\entity\EntityFieldQuery
|
||||
* @return Drupal\Core\Entity\EntityFieldQuery
|
||||
* The called object.
|
||||
*/
|
||||
public function count() {
|
||||
|
@ -548,7 +548,7 @@ class EntityFieldQuery {
|
|||
* @param $length
|
||||
* The number of entities to return from the result set.
|
||||
*
|
||||
* @return Drupal\entity\EntityFieldQuery
|
||||
* @return Drupal\Core\Entity\EntityFieldQuery
|
||||
* The called object.
|
||||
*/
|
||||
public function range($start = NULL, $length = NULL) {
|
||||
|
@ -569,7 +569,7 @@ class EntityFieldQuery {
|
|||
* An optional integer to distinguish between multiple pagers on one page.
|
||||
* If not provided, one is automatically calculated.
|
||||
*
|
||||
* @return Drupal\entity\EntityFieldQuery
|
||||
* @return Drupal\Core\Entity\EntityFieldQuery
|
||||
* The called object.
|
||||
*/
|
||||
public function pager($limit = 10, $element = NULL) {
|
||||
|
@ -594,7 +594,7 @@ class EntityFieldQuery {
|
|||
* An EFQ Header array based on which the order clause is added to the
|
||||
* query.
|
||||
*
|
||||
* @return Drupal\entity\EntityFieldQuery
|
||||
* @return Drupal\Core\Entity\EntityFieldQuery
|
||||
* The called object.
|
||||
*/
|
||||
public function tableSort(&$headers) {
|
||||
|
@ -629,7 +629,7 @@ class EntityFieldQuery {
|
|||
* TRUE to only return deleted data, FALSE to return non-deleted data,
|
||||
* EntityFieldQuery::RETURN_ALL to return everything. Defaults to FALSE.
|
||||
*
|
||||
* @return Drupal\entity\EntityFieldQuery
|
||||
* @return Drupal\Core\Entity\EntityFieldQuery
|
||||
* The called object.
|
||||
*/
|
||||
public function deleted($deleted = TRUE) {
|
||||
|
@ -650,7 +650,7 @@ class EntityFieldQuery {
|
|||
* - FIELD_LOAD_REVISION: Query all revisions. The results will be keyed by
|
||||
* entity type and entity revision ID.
|
||||
*
|
||||
* @return Drupal\entity\EntityFieldQuery
|
||||
* @return Drupal\Core\Entity\EntityFieldQuery
|
||||
* The called object.
|
||||
*/
|
||||
public function age($age) {
|
||||
|
@ -675,7 +675,7 @@ class EntityFieldQuery {
|
|||
* @param string $tag
|
||||
* The tag to add.
|
||||
*
|
||||
* @return Drupal\entity\EntityFieldQuery
|
||||
* @return Drupal\Core\Entity\EntityFieldQuery
|
||||
* The called object.
|
||||
*/
|
||||
public function addTag($tag) {
|
||||
|
@ -696,7 +696,7 @@ class EntityFieldQuery {
|
|||
* @param $object
|
||||
* The additional data to add to the query. May be any valid PHP variable.
|
||||
*
|
||||
* @return Drupal\entity\EntityFieldQuery
|
||||
* @return Drupal\Core\Entity\EntityFieldQuery
|
||||
* The called object.
|
||||
*/
|
||||
public function addMetaData($key, $object) {
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\entity\EntityFieldQueryException.
|
||||
* Definition of Drupal\Core\Entity\EntityFieldQueryException.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity;
|
||||
namespace Drupal\Core\Entity;
|
||||
|
||||
use Exception;
|
||||
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\entity\EntityFormController.
|
||||
* Definition of Drupal\Core\Entity\EntityFormController.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity;
|
||||
namespace Drupal\Core\Entity;
|
||||
|
||||
/**
|
||||
* Base class for entity form controllers.
|
||||
|
@ -23,14 +23,14 @@ class EntityFormController implements EntityFormControllerInterface {
|
|||
protected $operation;
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityFormControllerInterface::__construct().
|
||||
* Implements Drupal\Core\Entity\EntityFormControllerInterface::__construct().
|
||||
*/
|
||||
public function __construct($operation) {
|
||||
$this->operation = $operation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityFormControllerInterface::build().
|
||||
* Implements Drupal\Core\Entity\EntityFormControllerInterface::build().
|
||||
*/
|
||||
public function build(array $form, array &$form_state, EntityInterface $entity) {
|
||||
|
||||
|
@ -68,7 +68,7 @@ class EntityFormController implements EntityFormControllerInterface {
|
|||
/**
|
||||
* Returns the actual form array to be built.
|
||||
*
|
||||
* @see Drupal\entity\EntityFormController::build()
|
||||
* @see Drupal\Core\Entity\EntityFormController::build()
|
||||
*/
|
||||
public function form(array $form, array &$form_state, EntityInterface $entity) {
|
||||
// @todo Exploit the Property API to generate the default widgets for the
|
||||
|
@ -142,7 +142,7 @@ class EntityFormController implements EntityFormControllerInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityFormControllerInterface::validate().
|
||||
* Implements Drupal\Core\Entity\EntityFormControllerInterface::validate().
|
||||
*/
|
||||
public function validate(array $form, array &$form_state) {
|
||||
// @todo Exploit the Property API to validate the values submitted for the
|
||||
|
@ -161,7 +161,7 @@ class EntityFormController implements EntityFormControllerInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityFormControllerInterface::submit().
|
||||
* Implements Drupal\Core\Entity\EntityFormControllerInterface::submit().
|
||||
*
|
||||
* This is the default entity object builder function. It is called before any
|
||||
* other submit handler to build the new entity object to be passed to the
|
||||
|
@ -205,7 +205,7 @@ class EntityFormController implements EntityFormControllerInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityFormControllerInterface::getFormLangcode().
|
||||
* Implements Drupal\Core\Entity\EntityFormControllerInterface::getFormLangcode().
|
||||
*/
|
||||
public function getFormLangcode(array $form_state) {
|
||||
$entity = $this->getEntity($form_state);
|
||||
|
@ -231,7 +231,7 @@ class EntityFormController implements EntityFormControllerInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityFormControllerInterface::buildEntity().
|
||||
* Implements Drupal\Core\Entity\EntityFormControllerInterface::buildEntity().
|
||||
*/
|
||||
public function buildEntity(array $form, array &$form_state) {
|
||||
$entity = clone $this->getEntity($form_state);
|
||||
|
@ -242,14 +242,14 @@ class EntityFormController implements EntityFormControllerInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityFormControllerInterface::getEntity().
|
||||
* Implements Drupal\Core\Entity\EntityFormControllerInterface::getEntity().
|
||||
*/
|
||||
public function getEntity(array $form_state) {
|
||||
return isset($form_state['entity']) ? $form_state['entity'] : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityFormControllerInterface::setEntity().
|
||||
* Implements Drupal\Core\Entity\EntityFormControllerInterface::setEntity().
|
||||
*/
|
||||
public function setEntity(EntityInterface $entity, array &$form_state) {
|
||||
$form_state['entity'] = $entity;
|
||||
|
@ -263,7 +263,7 @@ class EntityFormController implements EntityFormControllerInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityFormControllerInterface::getOperation().
|
||||
* Implements Drupal\Core\Entity\EntityFormControllerInterface::getOperation().
|
||||
*/
|
||||
public function getOperation() {
|
||||
return $this->operation;
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\entity\EntityFormControllerInterface.
|
||||
* Definition of Drupal\Core\Entity\EntityFormControllerInterface.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity;
|
||||
namespace Drupal\Core\Entity;
|
||||
|
||||
/**
|
||||
* Defines a common interface for entity form controller classes.
|
||||
|
@ -32,7 +32,7 @@ interface EntityFormControllerInterface {
|
|||
* An associative array containing the current state of the form.
|
||||
* @param string $entity_type
|
||||
* The type of the entity being edited.
|
||||
* @param \Drupal\entity\EntityInterface $entity
|
||||
* @param \Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity being edited.
|
||||
*
|
||||
* @return array
|
||||
|
@ -67,7 +67,7 @@ interface EntityFormControllerInterface {
|
|||
* @param array $form_state
|
||||
* An associative array containing the current state of the form.
|
||||
*
|
||||
* @return \Drupal\entity\EntityInterface
|
||||
* @return \Drupal\Core\Entity\EntityInterface
|
||||
* The current form entity.
|
||||
*/
|
||||
public function getEntity(array $form_state);
|
||||
|
@ -77,11 +77,11 @@ interface EntityFormControllerInterface {
|
|||
*
|
||||
* Sets the form entity which will be used for populating form element
|
||||
* defaults. Usually, the form entity gets updated by
|
||||
* \Drupal\entity\EntityFormControllerInterface::submit(), however this may
|
||||
* \Drupal\Core\Entity\EntityFormControllerInterface::submit(), however this may
|
||||
* be used to completely exchange the form entity, e.g. when preparing the
|
||||
* rebuild of a multi-step form.
|
||||
*
|
||||
* @param \Drupal\entity\EntityInterface $entity
|
||||
* @param \Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity the current form should operate upon.
|
||||
* @param array $form_state
|
||||
* An associative array containing the current state of the form.
|
||||
|
@ -95,14 +95,14 @@ interface EntityFormControllerInterface {
|
|||
* the submitted form values are copied to entity properties. The form's
|
||||
* entity remains unchanged.
|
||||
*
|
||||
* @see \Drupal\entity\EntityFormControllerInterface::getEntity()
|
||||
* @see \Drupal\Core\Entity\EntityFormControllerInterface::getEntity()
|
||||
*
|
||||
* @param array $form
|
||||
* A nested array form elements comprising the form.
|
||||
* @param array $form_state
|
||||
* An associative array containing the current state of the form.
|
||||
*
|
||||
* @return \Drupal\entity\EntityInterface
|
||||
* @return \Drupal\Core\Entity\EntityInterface
|
||||
* An updated copy of the form's entity object.
|
||||
*/
|
||||
public function buildEntity(array $form, array &$form_state);
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\entity\EntityInterface.
|
||||
* Definition of Drupal\Core\Entity\EntityInterface.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity;
|
||||
namespace Drupal\Core\Entity;
|
||||
|
||||
/**
|
||||
* Defines a common interface for all entity objects.
|
||||
|
@ -52,7 +52,7 @@ interface EntityInterface {
|
|||
* @return
|
||||
* TRUE if the entity is new, or FALSE if the entity has already been saved.
|
||||
*
|
||||
* @see Drupal\entity\EntityInterface::enforceIsNew()
|
||||
* @see Drupal\Core\Entity\EntityInterface::enforceIsNew()
|
||||
*/
|
||||
public function isNew();
|
||||
|
||||
|
@ -66,7 +66,7 @@ interface EntityInterface {
|
|||
* (optional) Whether the entity should be forced to be new. Defaults to
|
||||
* TRUE.
|
||||
*
|
||||
* @see Drupal\entity\EntityInterface::isNew()
|
||||
* @see Drupal\Core\Entity\EntityInterface::isNew()
|
||||
*/
|
||||
public function enforceIsNew($value = TRUE);
|
||||
|
||||
|
@ -117,7 +117,7 @@ interface EntityInterface {
|
|||
* The language object of the entity's default language, or FALSE if the
|
||||
* entity is not language-specific.
|
||||
*
|
||||
* @see Drupal\entity\EntityInterface::translations()
|
||||
* @see Drupal\Core\Entity\EntityInterface::translations()
|
||||
*/
|
||||
public function language();
|
||||
|
||||
|
@ -127,7 +127,7 @@ interface EntityInterface {
|
|||
* @return
|
||||
* An array of language objects, keyed by language codes.
|
||||
*
|
||||
* @see Drupal\entity\EntityInterface::language()
|
||||
* @see Drupal\Core\Entity\EntityInterface::language()
|
||||
*/
|
||||
public function translations();
|
||||
|
||||
|
@ -144,7 +144,7 @@ interface EntityInterface {
|
|||
* @return
|
||||
* The property value, or NULL if it is not defined.
|
||||
*
|
||||
* @see Drupal\entity\EntityInterface::language()
|
||||
* @see Drupal\Core\Entity\EntityInterface::language()
|
||||
*/
|
||||
public function get($property_name, $langcode = NULL);
|
||||
|
||||
|
@ -160,7 +160,7 @@ interface EntityInterface {
|
|||
* language that should be used for setting the property. If set to NULL,
|
||||
* the entity's default language is being used.
|
||||
*
|
||||
* @see Drupal\entity\EntityInterface::language()
|
||||
* @see Drupal\Core\Entity\EntityInterface::language()
|
||||
*/
|
||||
public function set($property_name, $value, $langcode = NULL);
|
||||
|
||||
|
@ -170,7 +170,7 @@ interface EntityInterface {
|
|||
* @return
|
||||
* Either SAVED_NEW or SAVED_UPDATED, depending on the operation performed.
|
||||
*
|
||||
* @throws Drupal\entity\EntityStorageException
|
||||
* @throws Drupal\Core\Entity\EntityStorageException
|
||||
* In case of failures an exception is thrown.
|
||||
*/
|
||||
public function save();
|
||||
|
@ -178,7 +178,7 @@ interface EntityInterface {
|
|||
/**
|
||||
* Deletes an entity permanently.
|
||||
*
|
||||
* @throws Drupal\entity\EntityStorageException
|
||||
* @throws Drupal\Core\Entity\EntityStorageException
|
||||
* In case of failures an exception is thrown.
|
||||
*/
|
||||
public function delete();
|
||||
|
@ -186,7 +186,7 @@ interface EntityInterface {
|
|||
/**
|
||||
* Creates a duplicate of the entity.
|
||||
*
|
||||
* @return Drupal\entity\EntityInterface
|
||||
* @return Drupal\Core\Entity\EntityInterface
|
||||
* A clone of the current entity with all identifiers unset, so saving
|
||||
* it inserts a new entity into the storage system.
|
||||
*/
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\entity\EntityMalformedException.
|
||||
* Definition of Drupal\Core\Entity\EntityMalformedException.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity;
|
||||
namespace Drupal\Core\Entity;
|
||||
|
||||
use Exception;
|
||||
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\entity\EntityStorageControllerInterface.
|
||||
* Definition of Drupal\Core\Entity\EntityStorageControllerInterface.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity;
|
||||
namespace Drupal\Core\Entity;
|
||||
|
||||
/**
|
||||
* Defines a common interface for entity controller classes.
|
||||
|
@ -15,13 +15,13 @@ namespace Drupal\entity;
|
|||
* this interface.
|
||||
*
|
||||
* Most simple, SQL-based entity controllers will do better by extending
|
||||
* Drupal\entity\DatabaseStorageController instead of implementing this
|
||||
* Drupal\Core\Entity\DatabaseStorageController instead of implementing this
|
||||
* interface directly.
|
||||
*/
|
||||
interface EntityStorageControllerInterface {
|
||||
|
||||
/**
|
||||
* Constructs a new Drupal\entity\EntityStorageControllerInterface object.
|
||||
* Constructs a new Drupal\Core\Entity\EntityStorageControllerInterface object.
|
||||
*
|
||||
* @param $entityType
|
||||
* The entity type for which the instance is created.
|
||||
|
@ -54,7 +54,7 @@ interface EntityStorageControllerInterface {
|
|||
* @param int $revision_id
|
||||
* The revision id.
|
||||
*
|
||||
* @return Drupal\entity\EntityInterface|false
|
||||
* @return Drupal\Core\Entity\EntityInterface|false
|
||||
* The specified entity revision or FALSE if not found.
|
||||
*/
|
||||
public function loadRevision($revision_id);
|
||||
|
@ -78,7 +78,7 @@ interface EntityStorageControllerInterface {
|
|||
* An array of values to set, keyed by property name. If the entity type has
|
||||
* bundles the bundle key has to be specified.
|
||||
*
|
||||
* @return Drupal\entity\EntityInterface
|
||||
* @return Drupal\Core\Entity\EntityInterface
|
||||
* A new entity object.
|
||||
*/
|
||||
public function create(array $values);
|
||||
|
@ -89,7 +89,7 @@ interface EntityStorageControllerInterface {
|
|||
* @param $ids
|
||||
* An array of entity IDs.
|
||||
*
|
||||
* @throws Drupal\entity\EntityStorageException
|
||||
* @throws Drupal\Core\Entity\EntityStorageException
|
||||
* In case of failures, an exception is thrown.
|
||||
*/
|
||||
public function delete($ids);
|
||||
|
@ -97,14 +97,14 @@ interface EntityStorageControllerInterface {
|
|||
/**
|
||||
* Saves the entity permanently.
|
||||
*
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity to save.
|
||||
*
|
||||
* @return
|
||||
* SAVED_NEW or SAVED_UPDATED is returned depending on the operation
|
||||
* performed.
|
||||
*
|
||||
* @throws Drupal\entity\EntityStorageException
|
||||
* @throws Drupal\Core\Entity\EntityStorageException
|
||||
* In case of failures, an exception is thrown.
|
||||
*/
|
||||
public function save(EntityInterface $entity);
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\entity\EntityStorageException.
|
||||
* Definition of Drupal\Core\Entity\EntityStorageException.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity;
|
||||
namespace Drupal\Core\Entity;
|
||||
|
||||
use Exception;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
|
||||
/**
|
||||
* @file
|
||||
|
|
|
@ -5,6 +5,5 @@ version = VERSION
|
|||
core = 8.x
|
||||
dependencies[] = node
|
||||
dependencies[] = text
|
||||
dependencies[] = entity
|
||||
configure = admin/content/comment
|
||||
stylesheets[all][] = comment.theme.css
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
use Drupal\node\Node;
|
||||
use Drupal\file\File;
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||
|
@ -1542,7 +1542,7 @@ function comment_delete_multiple($cids) {
|
|||
* An array of comment objects, indexed by comment ID.
|
||||
*
|
||||
* @see entity_load()
|
||||
* @see Drupal\entity\EntityFieldQuery
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery
|
||||
*/
|
||||
function comment_load_multiple(array $cids = NULL, $reset = FALSE) {
|
||||
return entity_load_multiple('comment', $cids, $reset);
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
namespace Drupal\comment;
|
||||
|
||||
use Drupal\entity\ContentEntityInterface;
|
||||
use Drupal\entity\Entity;
|
||||
use Drupal\Core\Entity\ContentEntityInterface;
|
||||
use Drupal\Core\Entity\Entity;
|
||||
|
||||
/**
|
||||
* Defines the comment entity class.
|
||||
|
@ -86,14 +86,14 @@ class Comment extends Entity implements ContentEntityInterface {
|
|||
public $homepage;
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityInterface::id().
|
||||
* Implements Drupal\Core\Entity\EntityInterface::id().
|
||||
*/
|
||||
public function id() {
|
||||
return $this->cid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityInterface::bundle().
|
||||
* Implements Drupal\Core\Entity\EntityInterface::bundle().
|
||||
*/
|
||||
public function bundle() {
|
||||
return $this->node_type;
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
namespace Drupal\comment;
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\entity\EntityFormController;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityFormController;
|
||||
|
||||
/**
|
||||
* Base for controller for comment forms.
|
||||
|
@ -16,7 +16,7 @@ use Drupal\entity\EntityFormController;
|
|||
class CommentFormController extends EntityFormController {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::form().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::form().
|
||||
*/
|
||||
public function form(array $form, array &$form_state, EntityInterface $comment) {
|
||||
global $user;
|
||||
|
@ -193,7 +193,7 @@ class CommentFormController extends EntityFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::actions().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::actions().
|
||||
*/
|
||||
protected function actions(array $form, array &$form_state) {
|
||||
$element = parent::actions($form, $form_state);
|
||||
|
@ -227,7 +227,7 @@ class CommentFormController extends EntityFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::validate().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::validate().
|
||||
*/
|
||||
public function validate(array $form, array &$form_state) {
|
||||
parent::validate($form, $form_state);
|
||||
|
@ -264,7 +264,7 @@ class CommentFormController extends EntityFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::submit().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::submit().
|
||||
*/
|
||||
public function submit(array $form, array &$form_state) {
|
||||
$comment = parent::submit($form, $form_state);
|
||||
|
@ -328,7 +328,7 @@ class CommentFormController extends EntityFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::save().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::save().
|
||||
*/
|
||||
public function save(array $form, array &$form_state) {
|
||||
$node = node_load($form_state['values']['nid']);
|
||||
|
|
|
@ -7,14 +7,14 @@
|
|||
|
||||
namespace Drupal\comment;
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\entity\DatabaseStorageController;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Entity\DatabaseStorageController;
|
||||
use LogicException;
|
||||
|
||||
/**
|
||||
* Defines the controller class for comments.
|
||||
*
|
||||
* This extends the Drupal\entity\DatabaseStorageController class, adding
|
||||
* This extends the Drupal\Core\Entity\DatabaseStorageController class, adding
|
||||
* required special handling for comment entities.
|
||||
*/
|
||||
class CommentStorageController extends DatabaseStorageController {
|
||||
|
@ -25,7 +25,7 @@ class CommentStorageController extends DatabaseStorageController {
|
|||
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::buildQuery().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::buildQuery().
|
||||
*/
|
||||
protected function buildQuery($ids, $revision_id = FALSE) {
|
||||
$query = parent::buildQuery($ids, $revision_id);
|
||||
|
@ -39,7 +39,7 @@ class CommentStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::attachLoad().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::attachLoad().
|
||||
*/
|
||||
protected function attachLoad(&$comments, $load_revision = FALSE) {
|
||||
// Set up standard comment properties.
|
||||
|
@ -53,7 +53,7 @@ class CommentStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::preSave().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::preSave().
|
||||
*
|
||||
* @see comment_int_to_alphadecimal()
|
||||
* @see comment_alphadecimal_to_int()
|
||||
|
@ -149,7 +149,7 @@ class CommentStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::postSave().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::postSave().
|
||||
*/
|
||||
protected function postSave(EntityInterface $comment, $update) {
|
||||
$this->releaseThreadLock();
|
||||
|
@ -161,7 +161,7 @@ class CommentStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::postDelete().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::postDelete().
|
||||
*/
|
||||
protected function postDelete($comments) {
|
||||
// Delete the comments' replies.
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
namespace Drupal\config;
|
||||
|
||||
use Drupal\entity\Entity;
|
||||
use Drupal\Core\Entity\Entity;
|
||||
|
||||
/**
|
||||
* Defines a base configuration entity class.
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
namespace Drupal\config;
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
|
||||
/**
|
||||
* Defines the interface common for all configuration entities.
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
namespace Drupal\config;
|
||||
|
||||
use Drupal\Component\Uuid\Uuid;
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\entity\EntityStorageControllerInterface;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityStorageControllerInterface;
|
||||
|
||||
/**
|
||||
* Defines the storage controller class for configuration entities.
|
||||
|
@ -56,7 +56,7 @@ class ConfigStorageController implements EntityStorageControllerInterface {
|
|||
protected $uuidKey = 'uuid';
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityStorageControllerInterface::__construct().
|
||||
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::__construct().
|
||||
*
|
||||
* Sets basic variables.
|
||||
*/
|
||||
|
@ -68,7 +68,7 @@ class ConfigStorageController implements EntityStorageControllerInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityStorageControllerInterface::resetCache().
|
||||
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::resetCache().
|
||||
*/
|
||||
public function resetCache(array $ids = NULL) {
|
||||
// The configuration system is fast enough and/or implements its own
|
||||
|
@ -76,7 +76,7 @@ class ConfigStorageController implements EntityStorageControllerInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityStorageControllerInterface::load().
|
||||
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::load().
|
||||
*/
|
||||
public function load(array $ids = NULL) {
|
||||
$entities = array();
|
||||
|
@ -115,14 +115,14 @@ class ConfigStorageController implements EntityStorageControllerInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityStorageControllerInterface::loadRevision().
|
||||
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::loadRevision().
|
||||
*/
|
||||
public function loadRevision($revision_id) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityStorageControllerInterface::loadByProperties().
|
||||
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::loadByProperties().
|
||||
*/
|
||||
public function loadByProperties(array $values = array()) {
|
||||
return array();
|
||||
|
@ -209,10 +209,10 @@ class ConfigStorageController implements EntityStorageControllerInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityStorageControllerInterface::create().
|
||||
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::create().
|
||||
*/
|
||||
public function create(array $values) {
|
||||
$class = isset($this->entityInfo['entity class']) ? $this->entityInfo['entity class'] : 'Drupal\entity\Entity';
|
||||
$class = isset($this->entityInfo['entity class']) ? $this->entityInfo['entity class'] : 'Drupal\Core\Entity\Entity';
|
||||
|
||||
$entity = new $class($values, $this->entityType);
|
||||
|
||||
|
@ -226,7 +226,7 @@ class ConfigStorageController implements EntityStorageControllerInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityStorageControllerInterface::delete().
|
||||
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::delete().
|
||||
*/
|
||||
public function delete($ids) {
|
||||
$entities = $ids ? $this->load($ids) : FALSE;
|
||||
|
@ -252,7 +252,7 @@ class ConfigStorageController implements EntityStorageControllerInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityStorageControllerInterface::save().
|
||||
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::save().
|
||||
*/
|
||||
public function save(EntityInterface $entity) {
|
||||
$prefix = $this->entityInfo['config prefix'] . '.';
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
name = Entity
|
||||
description = API for managing entities like nodes and users.
|
||||
package = Core
|
||||
version = VERSION
|
||||
core = 8.x
|
||||
required = TRUE
|
|
@ -1942,18 +1942,18 @@ function hook_field_storage_delete_revision($entity_type, $entity, $fields) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Execute a Drupal\entity\EntityFieldQuery.
|
||||
* Execute a Drupal\Core\Entity\EntityFieldQuery.
|
||||
*
|
||||
* This hook is called to find the entities having certain entity and field
|
||||
* conditions and sort them in the given field order. If the field storage
|
||||
* engine also handles property sorts and orders, it should unset those
|
||||
* properties in the called object to signal that those have been handled.
|
||||
*
|
||||
* @param Drupal\entity\EntityFieldQuery $query
|
||||
* @param Drupal\Core\Entity\EntityFieldQuery $query
|
||||
* An EntityFieldQuery.
|
||||
*
|
||||
* @return
|
||||
* See Drupal\entity\EntityFieldQuery::execute() for the return values.
|
||||
* See Drupal\Core\Entity\EntityFieldQuery::execute() for the return values.
|
||||
*/
|
||||
function hook_field_storage_query($query) {
|
||||
$groups = array();
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
use Drupal\field\FieldValidationException;
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
|
||||
/**
|
||||
* @defgroup field_storage Field Storage API
|
||||
|
@ -123,7 +123,7 @@ const FIELD_STORAGE_INSERT = 'insert';
|
|||
* - prepare translation
|
||||
* @param $entity_type
|
||||
* The type of $entity; e.g. 'node' or 'user'.
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The fully formed $entity_type entity.
|
||||
* @param $a
|
||||
* - The $form in the 'form' operation.
|
||||
|
@ -519,7 +519,7 @@ function _field_invoke_get_instances($entity_type, $bundle, $options) {
|
|||
*
|
||||
* @param $entity_type
|
||||
* The type of $entity; e.g. 'node' or 'user'.
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity for which to load form elements, used to initialize
|
||||
* default form values.
|
||||
* @param $form
|
||||
|
@ -739,7 +739,7 @@ function field_attach_load_revision($entity_type, $entities, $options = array())
|
|||
*
|
||||
* @param $entity_type
|
||||
* The type of $entity; e.g. 'node' or 'user'.
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity with fields to validate.
|
||||
* @throws Drupal\field\FieldValidationException
|
||||
* If validation errors are found, a FieldValidationException is thrown. The
|
||||
|
@ -784,7 +784,7 @@ function field_attach_validate($entity_type, $entity) {
|
|||
*
|
||||
* @param $entity_type
|
||||
* The type of $entity; e.g. 'node' or 'user'.
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity being submitted. The 'bundle', 'id' and (if applicable)
|
||||
* 'revision' keys should be present. The actual field values will be read
|
||||
* from $form_state['values'].
|
||||
|
@ -824,7 +824,7 @@ function field_attach_form_validate($entity_type, EntityInterface $entity, $form
|
|||
*
|
||||
* @param $entity_type
|
||||
* The type of $entity; e.g. 'node' or 'user'.
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity being submitted. The 'bundle', 'id' and (if applicable)
|
||||
* 'revision' keys should be present. The actual field values will be read
|
||||
* from $form_state['values'].
|
||||
|
@ -876,7 +876,7 @@ function field_attach_presave($entity_type, $entity) {
|
|||
*
|
||||
* @param $entity_type
|
||||
* The type of $entity; e.g. 'node' or 'user'.
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity with fields to save.
|
||||
* @return
|
||||
* Default values (if any) will be added to the $entity parameter for fields
|
||||
|
@ -925,7 +925,7 @@ function field_attach_insert($entity_type, EntityInterface $entity) {
|
|||
*
|
||||
* @param $entity_type
|
||||
* The type of $entity; e.g. 'node' or 'user'.
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity with fields to save.
|
||||
*/
|
||||
function field_attach_update($entity_type, EntityInterface $entity) {
|
||||
|
@ -978,7 +978,7 @@ function field_attach_update($entity_type, EntityInterface $entity) {
|
|||
*
|
||||
* @param $entity_type
|
||||
* The type of $entity; e.g. 'node' or 'user'.
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity whose field data to delete.
|
||||
*/
|
||||
function field_attach_delete($entity_type, $entity) {
|
||||
|
@ -1013,7 +1013,7 @@ function field_attach_delete($entity_type, $entity) {
|
|||
*
|
||||
* @param $entity_type
|
||||
* The type of $entity; e.g. 'node' or 'user'.
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity with fields to save.
|
||||
*/
|
||||
function field_attach_delete_revision($entity_type, $entity) {
|
||||
|
@ -1128,7 +1128,7 @@ function field_attach_prepare_view($entity_type, $entities, $view_mode, $langcod
|
|||
*
|
||||
* @param $entity_type
|
||||
* The type of $entity; e.g. 'node' or 'user'.
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity with fields to render.
|
||||
* @param $view_mode
|
||||
* View mode, e.g. 'full', 'teaser'...
|
||||
|
@ -1181,7 +1181,7 @@ function field_attach_view($entity_type, EntityInterface $entity, $view_mode, $l
|
|||
*
|
||||
* @param $entity_type
|
||||
* The type of $entity; e.g. 'node' or 'user'.
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity with fields to render.
|
||||
* @param $element
|
||||
* The structured array containing the values ready for rendering.
|
||||
|
@ -1221,7 +1221,7 @@ function field_attach_preprocess($entity_type, EntityInterface $entity, $element
|
|||
*
|
||||
* @param $entity_type
|
||||
* The type of $entity; e.g. 'node' or 'user'.
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity to be prepared for translation.
|
||||
* @param $langcode
|
||||
* The language the entity has to be translated in.
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
use Drupal\field\FieldException;
|
||||
use Drupal\entity\EntityFieldQuery;
|
||||
use Drupal\Core\Entity\EntityFieldQuery;
|
||||
|
||||
/**
|
||||
* @defgroup field_crud Field CRUD API
|
||||
|
|
|
@ -4,6 +4,5 @@ package = Core
|
|||
version = VERSION
|
||||
core = 8.x
|
||||
dependencies[] = field_sql_storage
|
||||
dependencies[] = entity
|
||||
required = TRUE
|
||||
stylesheets[all][] = theme/field.css
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* Attach custom data fields to Drupal entities.
|
||||
*/
|
||||
|
||||
use Drupal\entity\EntityFieldQuery;
|
||||
use Drupal\Core\Entity\EntityFieldQuery;
|
||||
use Drupal\Core\Template\Attribute;
|
||||
|
||||
/*
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
namespace Drupal\field\Tests;
|
||||
|
||||
use Drupal\entity\EntityFieldQuery;
|
||||
use Drupal\Core\Entity\EntityFieldQuery;
|
||||
|
||||
/**
|
||||
* Unit test class for field bulk delete and batch purge functionality.
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
use Drupal\Core\Database\Database;
|
||||
use Drupal\Core\Database\Query\Select;
|
||||
use Drupal\entity\EntityFieldQuery;
|
||||
use Drupal\entity\EntityFieldQueryException;
|
||||
use Drupal\Core\Entity\EntityFieldQuery;
|
||||
use Drupal\Core\Entity\EntityFieldQueryException;
|
||||
use Drupal\field\FieldUpdateForbiddenException;
|
||||
|
||||
/**
|
||||
|
@ -620,7 +620,7 @@ function _field_sql_storage_query_join_entity(Select $select_query, $entity_type
|
|||
/**
|
||||
* Adds field (meta) conditions to the given query objects respecting groupings.
|
||||
*
|
||||
* @param Drupal\entity\EntityFieldQuery $query
|
||||
* @param Drupal\Core\Entity\EntityFieldQuery $query
|
||||
* The field query object to be processed.
|
||||
* @param SelectQuery $select_query
|
||||
* The SelectQuery that should get grouping conditions.
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
use Drupal\field\FieldUpdateForbiddenException;
|
||||
use Drupal\entity\EntityFieldQuery;
|
||||
use Drupal\Core\Entity\EntityFieldQuery;
|
||||
|
||||
/**
|
||||
* Implements hook_help().
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* Defines an entity type.
|
||||
*/
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\field_test\TestEntity;
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* test helper functions
|
||||
*/
|
||||
|
||||
use Drupal\entity\EntityFieldQuery;
|
||||
use Drupal\Core\Entity\EntityFieldQuery;
|
||||
|
||||
require_once DRUPAL_ROOT . '/core/modules/field/tests/modules/field_test/field_test.entity.inc';
|
||||
require_once DRUPAL_ROOT . '/core/modules/field/tests/modules/field_test/field_test.field.inc';
|
||||
|
@ -278,7 +278,7 @@ function field_test_field_widget_form_alter(&$element, &$form_state, $context) {
|
|||
/**
|
||||
* Implements hook_query_TAG_alter() for tag 'efq_table_prefixing_test'.
|
||||
*
|
||||
* @see Drupal\entity\Tests\EntityFieldQueryTest::testTablePrefixing()
|
||||
* @see Drupal\system\Tests\Entity\EntityFieldQueryTest::testTablePrefixing()
|
||||
*/
|
||||
function field_test_query_efq_table_prefixing_test_alter(&$query) {
|
||||
// Add an additional join onto the entity base table. This will cause an
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
namespace Drupal\field_test;
|
||||
|
||||
use Drupal\entity\Entity;
|
||||
use Drupal\Core\Entity\Entity;
|
||||
|
||||
/**
|
||||
* Test entity class.
|
||||
|
@ -36,21 +36,21 @@ class TestEntity extends Entity {
|
|||
public $fttype;
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\Entity::id().
|
||||
* Overrides Drupal\Core\Entity\Entity::id().
|
||||
*/
|
||||
public function id() {
|
||||
return $this->ftid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\Entity::getRevisionId().
|
||||
* Overrides Drupal\Core\Entity\Entity::getRevisionId().
|
||||
*/
|
||||
public function getRevisionId() {
|
||||
return $this->ftvid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\Entity::bundle().
|
||||
* Overrides Drupal\Core\Entity\Entity::bundle().
|
||||
*/
|
||||
public function bundle() {
|
||||
return !empty($this->fttype) ? $this->fttype : $this->entityType();
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
namespace Drupal\field_test;
|
||||
|
||||
use Drupal\entity\DatabaseStorageController;
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\Core\Entity\DatabaseStorageController;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
|
||||
/**
|
||||
* Controller class for the test entity entity types.
|
||||
|
@ -16,7 +16,7 @@ use Drupal\entity\EntityInterface;
|
|||
class TestEntityController extends DatabaseStorageController {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::preSave().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::preSave().
|
||||
*/
|
||||
public function preSave(EntityInterface $entity) {
|
||||
// Prepare for a new revision.
|
||||
|
@ -27,7 +27,7 @@ class TestEntityController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::postSave().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::postSave().
|
||||
*/
|
||||
public function postSave(EntityInterface $entity, $update) {
|
||||
// Only the test_entity entity type has revisions.
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
namespace Drupal\field_test;
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\entity\EntityFormController;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityFormController;
|
||||
|
||||
/**
|
||||
* Form controller for the test entity edit forms.
|
||||
|
@ -16,7 +16,7 @@ use Drupal\entity\EntityFormController;
|
|||
class TestEntityFormController extends EntityFormController {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::form().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::form().
|
||||
*/
|
||||
public function form(array $form, array &$form_state, EntityInterface $entity) {
|
||||
$form = parent::form($form, $form_state, $entity);
|
||||
|
@ -33,7 +33,7 @@ class TestEntityFormController extends EntityFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::save().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::save().
|
||||
*/
|
||||
public function save(array $form, array &$form_state) {
|
||||
$entity = $this->getEntity($form_state);
|
||||
|
|
|
@ -172,7 +172,7 @@ function hook_file_delete(Drupal\file\File $file) {
|
|||
*
|
||||
* @param $field
|
||||
* The field to which the file belongs.
|
||||
* @param Drupal\entity\EntityInterface $entity
|
||||
* @param Drupal\Core\Entity\EntityInterface $entity
|
||||
* The entity which references the file.
|
||||
* @param Drupal\file\File $file
|
||||
* The file entity that is being requested.
|
||||
|
@ -184,7 +184,7 @@ function hook_file_delete(Drupal\file\File $file) {
|
|||
*
|
||||
* @see hook_field_access().
|
||||
*/
|
||||
function hook_file_download_access($field, Drupal\entity\EntityInterface $entity, Drupal\file\File $file) {
|
||||
function hook_file_download_access($field, Drupal\Core\Entity\EntityInterface $entity, Drupal\file\File $file) {
|
||||
if ($entity->entityType() == 'node') {
|
||||
return node_access('view', $entity);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* Defines a "managed_file" Form API field and a "file" field for Field module.
|
||||
*/
|
||||
|
||||
use Drupal\entity\EntityFieldQuery;
|
||||
use Drupal\Core\Entity\EntityFieldQuery;
|
||||
use Drupal\file\File;
|
||||
use Drupal\Core\Template\Attribute;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
@ -116,7 +116,7 @@ function file_entity_info() {
|
|||
* @see hook_file_load()
|
||||
* @see file_load()
|
||||
* @see entity_load()
|
||||
* @see Drupal\entity\EntityFieldQuery
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery
|
||||
*/
|
||||
function file_load_multiple(array $fids = NULL) {
|
||||
return entity_load_multiple('file', $fids);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
namespace Drupal\file;
|
||||
|
||||
use Drupal\entity\Entity;
|
||||
use Drupal\Core\Entity\Entity;
|
||||
|
||||
/**
|
||||
* Defines the file entity class.
|
||||
|
@ -92,7 +92,7 @@ class File extends Entity {
|
|||
public $timestamp;
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\Entity::id().
|
||||
* Overrides Drupal\Core\Entity\Entity::id().
|
||||
*/
|
||||
public function id() {
|
||||
return $this->fid;
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
namespace Drupal\file;
|
||||
|
||||
use Drupal\entity\DatabaseStorageController;
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\Core\Entity\DatabaseStorageController;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
|
||||
/**
|
||||
* File storage controller for files.
|
||||
|
@ -16,7 +16,7 @@ use Drupal\entity\EntityInterface;
|
|||
class FileStorageController extends DatabaseStorageController {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::create().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::create().
|
||||
*/
|
||||
public function create(array $values) {
|
||||
// Automatically detect filename if not set.
|
||||
|
@ -32,7 +32,7 @@ class FileStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::presave().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::presave().
|
||||
*/
|
||||
protected function preSave(EntityInterface $entity) {
|
||||
$entity->timestamp = REQUEST_TIME;
|
||||
|
@ -47,7 +47,7 @@ class FileStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::preDelete().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::preDelete().
|
||||
*/
|
||||
public function preDelete($entities) {
|
||||
foreach ($entities as $entity) {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* Provides File module pages for testing purposes.
|
||||
*/
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\file\File;
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
namespace Drupal\node;
|
||||
|
||||
use Drupal\entity\ContentEntityInterface;
|
||||
use Drupal\entity\Entity;
|
||||
use Drupal\Core\Entity\ContentEntityInterface;
|
||||
use Drupal\Core\Entity\Entity;
|
||||
|
||||
/**
|
||||
* Defines the node entity class.
|
||||
|
@ -163,21 +163,21 @@ class Node extends Entity implements ContentEntityInterface {
|
|||
public $revision_uid;
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityInterface::id().
|
||||
* Implements Drupal\Core\Entity\EntityInterface::id().
|
||||
*/
|
||||
public function id() {
|
||||
return $this->nid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityInterface::bundle().
|
||||
* Implements Drupal\Core\Entity\EntityInterface::bundle().
|
||||
*/
|
||||
public function bundle() {
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\Entity::createDuplicate().
|
||||
* Overrides Drupal\Core\Entity\Entity::createDuplicate().
|
||||
*/
|
||||
public function createDuplicate() {
|
||||
$duplicate = parent::createDuplicate();
|
||||
|
@ -186,7 +186,7 @@ class Node extends Entity implements ContentEntityInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\Entity::getRevisionId().
|
||||
* Overrides Drupal\Core\Entity\Entity::getRevisionId().
|
||||
*/
|
||||
public function getRevisionId() {
|
||||
return $this->vid;
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
namespace Drupal\node;
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\entity\EntityFormController;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityFormController;
|
||||
|
||||
/**
|
||||
* Form controller for the node edit forms.
|
||||
|
@ -21,7 +21,7 @@ class NodeFormController extends EntityFormController {
|
|||
* Fills in a few default values, and then invokes hook_prepare() on the node
|
||||
* type module, and hook_node_prepare() on all modules.
|
||||
*
|
||||
* Overrides Drupal\entity\EntityFormController::prepareEntity().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::prepareEntity().
|
||||
*/
|
||||
protected function prepareEntity(EntityInterface $node) {
|
||||
// Set up default values, if required.
|
||||
|
@ -51,7 +51,7 @@ class NodeFormController extends EntityFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::form().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::form().
|
||||
*/
|
||||
public function form(array $form, array &$form_state, EntityInterface $node) {
|
||||
$user_config = config('user.settings');
|
||||
|
@ -243,7 +243,7 @@ class NodeFormController extends EntityFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::actions().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::actions().
|
||||
*/
|
||||
protected function actions(array $form, array &$form_state) {
|
||||
$element = parent::actions($form, $form_state);
|
||||
|
@ -269,7 +269,7 @@ class NodeFormController extends EntityFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::validate().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::validate().
|
||||
*/
|
||||
public function validate(array $form, array &$form_state) {
|
||||
$node = $this->buildEntity($form, $form_state);
|
||||
|
@ -314,7 +314,7 @@ class NodeFormController extends EntityFormController {
|
|||
* form state's entity with the current step's values before proceeding to the
|
||||
* next step.
|
||||
*
|
||||
* Overrides Drupal\entity\EntityFormController::submit().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::submit().
|
||||
*/
|
||||
public function submit(array $form, array &$form_state) {
|
||||
$this->submitNodeLanguage($form, $form_state);
|
||||
|
@ -376,7 +376,7 @@ class NodeFormController extends EntityFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::save().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::save().
|
||||
*/
|
||||
public function save(array $form, array &$form_state) {
|
||||
$node = $this->getEntity($form_state);
|
||||
|
@ -412,7 +412,7 @@ class NodeFormController extends EntityFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::delete().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::delete().
|
||||
*/
|
||||
public function delete(array $form, array &$form_state) {
|
||||
$destination = array();
|
||||
|
|
|
@ -7,21 +7,21 @@
|
|||
|
||||
namespace Drupal\node;
|
||||
|
||||
use Drupal\entity\DatabaseStorageController;
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\entity\EntityStorageException;
|
||||
use Drupal\Core\Entity\DatabaseStorageController;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityStorageException;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Controller class for nodes.
|
||||
*
|
||||
* This extends the Drupal\entity\DatabaseStorageController class, adding
|
||||
* This extends the Drupal\Core\Entity\DatabaseStorageController class, adding
|
||||
* required special handling for node entities.
|
||||
*/
|
||||
class NodeStorageController extends DatabaseStorageController {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::create().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::create().
|
||||
*/
|
||||
public function create(array $values) {
|
||||
$node = parent::create($values);
|
||||
|
@ -35,7 +35,7 @@ class NodeStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::delete().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::delete().
|
||||
*/
|
||||
public function delete($ids) {
|
||||
$entities = $ids ? $this->load($ids) : FALSE;
|
||||
|
@ -80,7 +80,7 @@ class NodeStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::save().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::save().
|
||||
*/
|
||||
public function save(EntityInterface $entity) {
|
||||
$transaction = db_transaction();
|
||||
|
@ -138,7 +138,7 @@ class NodeStorageController extends DatabaseStorageController {
|
|||
/**
|
||||
* Saves a node revision.
|
||||
*
|
||||
* @param Drupal\entity\EntityInterface $node
|
||||
* @param Drupal\Core\Entity\EntityInterface $node
|
||||
* The node entity.
|
||||
*/
|
||||
protected function saveRevision(EntityInterface $entity) {
|
||||
|
@ -164,7 +164,7 @@ class NodeStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::attachLoad().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::attachLoad().
|
||||
*/
|
||||
protected function attachLoad(&$nodes, $load_revision = FALSE) {
|
||||
// Create an array of nodes for each content type and pass this to the
|
||||
|
@ -189,7 +189,7 @@ class NodeStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::buildQuery().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::buildQuery().
|
||||
*/
|
||||
protected function buildQuery($ids, $revision_id = FALSE) {
|
||||
// Ensure that uid is taken from the {node} table,
|
||||
|
@ -204,7 +204,7 @@ class NodeStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::invokeHook().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::invokeHook().
|
||||
*/
|
||||
protected function invokeHook($hook, EntityInterface $node) {
|
||||
if ($hook == 'insert' || $hook == 'update') {
|
||||
|
@ -253,7 +253,7 @@ class NodeStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::preSave().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::preSave().
|
||||
*/
|
||||
protected function preSave(EntityInterface $node) {
|
||||
// Before saving the node, set changed and revision times.
|
||||
|
@ -269,7 +269,7 @@ class NodeStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::postSave().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::postSave().
|
||||
*/
|
||||
function postSave(EntityInterface $node, $update) {
|
||||
// Update the node access table for this node, but only if it is the
|
||||
|
@ -280,7 +280,7 @@ class NodeStorageController extends DatabaseStorageController {
|
|||
}
|
||||
}
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::preDelete().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::preDelete().
|
||||
*/
|
||||
function preDelete($entities) {
|
||||
if (module_exists('search')) {
|
||||
|
@ -291,7 +291,7 @@ class NodeStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::postDelete().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::postDelete().
|
||||
*/
|
||||
protected function postDelete($nodes) {
|
||||
// Delete values from other tables also referencing this node.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
|
||||
/**
|
||||
* @file
|
||||
|
@ -531,7 +531,7 @@ function hook_node_insert(Drupal\node\Node $node) {
|
|||
* Act on nodes being loaded from the database.
|
||||
*
|
||||
* This hook is invoked during node loading, which is handled by entity_load(),
|
||||
* via classes NodeController and Drupal\entity\DatabaseStorageController.
|
||||
* via classes NodeController and Drupal\Core\Entity\DatabaseStorageController.
|
||||
* After the node information is read from the database or the entity cache,
|
||||
* hook_load() is invoked on the node's content type module, then
|
||||
* field_attach_node_revision() or field_attach_load() is called, then
|
||||
|
@ -1168,7 +1168,7 @@ function hook_insert(Drupal\node\Node $node) {
|
|||
* (use hook_node_load() to respond to all node loads).
|
||||
*
|
||||
* This hook is invoked during node loading, which is handled by entity_load(),
|
||||
* via classes NodeController and Drupal\entity\DatabaseStorageController.
|
||||
* via classes NodeController and Drupal\Core\Entity\DatabaseStorageController.
|
||||
* After the node information is read from the database or the entity cache,
|
||||
* hook_load() is invoked on the node's content type module, then
|
||||
* field_attach_node_revision() or field_attach_load() is called, then
|
||||
|
|
|
@ -3,5 +3,4 @@ description = Allows content to be submitted to the site and displayed on pages.
|
|||
package = Core
|
||||
version = VERSION
|
||||
core = 8.x
|
||||
dependencies[] = entity
|
||||
configure = admin/structure/types
|
||||
|
|
|
@ -16,7 +16,7 @@ use Drupal\Core\Database\Query\SelectInterface;
|
|||
use Drupal\Core\Template\Attribute;
|
||||
use Drupal\node\Node;
|
||||
use Drupal\file\File;
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
|
||||
/**
|
||||
* Denotes that the node is not published.
|
||||
|
@ -1022,7 +1022,7 @@ function node_invoke($node, $hook, $a2 = NULL, $a3 = NULL, $a4 = NULL) {
|
|||
* An array of node entities indexed by nid.
|
||||
*
|
||||
* @see entity_load_multiple()
|
||||
* @see Drupal\entity\EntityFieldQuery
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery
|
||||
*/
|
||||
function node_load_multiple(array $nids = NULL, $reset = FALSE) {
|
||||
return entity_load_multiple('node', $nids, $reset);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* a special 'node test view' permission.
|
||||
*/
|
||||
|
||||
use Drupal\entity\EntityFieldQuery;
|
||||
use Drupal\Core\Entity\EntityFieldQuery;
|
||||
|
||||
use Drupal\node\Node;
|
||||
|
||||
|
|
|
@ -155,7 +155,7 @@ function node_test_node_update(Node $node) {
|
|||
/**
|
||||
* Implements hook_entity_view_mode_alter().
|
||||
*/
|
||||
function node_test_entity_view_mode_alter(&$view_mode, Drupal\entity\EntityInterface $entity, $context) {
|
||||
function node_test_entity_view_mode_alter(&$view_mode, Drupal\Core\Entity\EntityInterface $entity, $context) {
|
||||
// Only alter the view mode if we are on the test callback.
|
||||
if ($change_view_mode = variable_get('node_test_change_view_mode', '')) {
|
||||
$view_mode = $change_view_mode;
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\entity\Tests\EntityApiInfoTest.
|
||||
* Definition of Drupal\system\Tests\Entity\EntityApiInfoTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity\Tests;
|
||||
namespace Drupal\system\Tests\Entity;
|
||||
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
|
||||
|
@ -52,6 +52,6 @@ class EntityApiInfoTest extends WebTestBase {
|
|||
module_enable(array('entity_cache_test'));
|
||||
$info = variable_get('entity_cache_test');
|
||||
$this->assertEqual($info['label'], 'Entity Cache Test', 'Entity info label is correct.');
|
||||
$this->assertEqual($info['controller class'], 'Drupal\entity\DatabaseStorageController', 'Entity controller class info is correct.');
|
||||
$this->assertEqual($info['controller class'], 'Drupal\Core\Entity\DatabaseStorageController', 'Entity controller class info is correct.');
|
||||
}
|
||||
}
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\entity\Tests\EntityApiTest.
|
||||
* Definition of Drupal\system\Tests\Entity\EntityApiTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity\Tests;
|
||||
namespace Drupal\system\Tests\Entity;
|
||||
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
|
||||
|
@ -19,7 +19,7 @@ class EntityApiTest extends WebTestBase {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $modules = array('entity', 'entity_test');
|
||||
public static $modules = array('entity_test');
|
||||
|
||||
public static function getInfo() {
|
||||
return array(
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\entity\Tests\EntityCrudHookTest.
|
||||
* Definition of Drupal\system\Tests\Entity\EntityCrudHookTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity\Tests;
|
||||
namespace Drupal\system\Tests\Entity;
|
||||
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
|
|
@ -2,19 +2,19 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\entity\Tests\EntityFieldQueryTest.
|
||||
* Definition of Drupal\system\Tests\Entity\EntityFieldQueryTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity\Tests;
|
||||
namespace Drupal\system\Tests\Entity;
|
||||
|
||||
use Drupal\simpletest\WebTestBase;
|
||||
use Drupal\entity\EntityFieldQuery;
|
||||
use Drupal\entity\EntityFieldQueryException;
|
||||
use Drupal\Core\Entity\EntityFieldQuery;
|
||||
use Drupal\Core\Entity\EntityFieldQueryException;
|
||||
use stdClass;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Tests Drupal\entity\EntityFieldQuery.
|
||||
* Tests Drupal\Core\Entity\EntityFieldQuery.
|
||||
*/
|
||||
class EntityFieldQueryTest extends WebTestBase {
|
||||
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\entity\Tests\EntityTranslationFormTest.
|
||||
* Definition of Drupal\system\Tests\Entity\EntityTranslationFormTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity\Tests;
|
||||
namespace Drupal\system\Tests\Entity;
|
||||
|
||||
use Exception;
|
||||
use InvalidArgumentException;
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\entity\Tests\EntityTranslationTest.
|
||||
* Definition of Drupal\system\Tests\Entity\EntityTranslationTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity\Tests;
|
||||
namespace Drupal\system\Tests\Entity;
|
||||
|
||||
use Exception;
|
||||
use InvalidArgumentException;
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* Definition of Drupal\entity\Tests\EntityUUIDTest.
|
||||
* Definition of Drupal\system\Tests\Entity\EntityUUIDTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\entity\Tests;
|
||||
namespace Drupal\system\Tests\Entity;
|
||||
|
||||
use Drupal\Component\Uuid\Uuid;
|
||||
use Drupal\simpletest\WebTestBase;
|
|
@ -38,9 +38,6 @@ class BareMinimalUpgradePathTest extends UpgradePathTestBase {
|
|||
public function testBasicMinimalUpgrade() {
|
||||
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
|
||||
|
||||
// Ensure that the new Entity module is enabled after upgrade.
|
||||
$this->assertTrue(module_exists('entity'), 'Entity module enabled after upgrade.');
|
||||
|
||||
// Hit the frontpage.
|
||||
$this->drupalGet('');
|
||||
$this->assertResponse(200);
|
||||
|
|
|
@ -39,9 +39,6 @@ class BareStandardUpgradePathTest extends UpgradePathTestBase {
|
|||
public function testBasicStandardUpgrade() {
|
||||
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
|
||||
|
||||
// Ensure that the new Entity module is enabled after upgrade.
|
||||
$this->assertTrue(module_exists('entity'), 'Entity module enabled after upgrade.');
|
||||
|
||||
// Hit the frontpage.
|
||||
$this->drupalGet('');
|
||||
$this->assertResponse(200);
|
||||
|
|
|
@ -38,9 +38,6 @@ class FilledMinimalUpgradePathTest extends UpgradePathTestBase {
|
|||
public function testFilledMinimalUpgrade() {
|
||||
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
|
||||
|
||||
// Ensure that the new Entity module is enabled after upgrade.
|
||||
$this->assertTrue(module_exists('entity'), 'Entity module enabled after upgrade.');
|
||||
|
||||
// Hit the frontpage.
|
||||
$this->drupalGet('');
|
||||
$this->assertResponse(200);
|
||||
|
|
|
@ -39,9 +39,6 @@ class FilledStandardUpgradePathTest extends UpgradePathTestBase {
|
|||
public function testFilledStandardUpgrade() {
|
||||
$this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.'));
|
||||
|
||||
// Ensure that the new Entity module is enabled after upgrade.
|
||||
$this->assertTrue(module_exists('entity'), 'Entity module enabled after upgrade.');
|
||||
|
||||
// Hit the frontpage.
|
||||
$this->drupalGet('');
|
||||
$this->assertResponse(200);
|
||||
|
|
|
@ -1495,13 +1495,6 @@ function system_update_last_removed() {
|
|||
* Update functions from 7.x to 8.x.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Enable entity module.
|
||||
*/
|
||||
function system_update_8000() {
|
||||
update_module_enable(array('entity'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Move from the Garland theme.
|
||||
*/
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* Test module for the Entity CRUD API.
|
||||
*/
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
|
||||
/**
|
||||
* Implements hook_entity_presave().
|
|
@ -5,8 +5,8 @@
|
|||
* Helper module for testing EntityFieldQuery access on any type of entity.
|
||||
*/
|
||||
|
||||
use Drupal\entity\EntityFieldQuery;
|
||||
use Drupal\entity\EntityFieldQueryException;
|
||||
use Drupal\Core\Entity\EntityFieldQuery;
|
||||
use Drupal\Core\Entity\EntityFieldQueryException;
|
||||
|
||||
/**
|
||||
* Implements hook_menu().
|
|
@ -3,5 +3,4 @@ description = Provides entity types based upon the CRUD API.
|
|||
package = Testing
|
||||
version = VERSION
|
||||
core = 8.x
|
||||
dependencies[] = entity
|
||||
hidden = TRUE
|
|
@ -9,7 +9,7 @@ namespace Drupal\entity_test;
|
|||
|
||||
use InvalidArgumentException;
|
||||
|
||||
use Drupal\entity\Entity;
|
||||
use Drupal\Core\Entity\Entity;
|
||||
|
||||
/**
|
||||
* Defines the test entity class.
|
|
@ -9,19 +9,19 @@ namespace Drupal\entity_test;
|
|||
|
||||
use PDO;
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\entity\DatabaseStorageController;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Entity\DatabaseStorageController;
|
||||
|
||||
/**
|
||||
* Defines the controller class for the test entity.
|
||||
*
|
||||
* This extends the Drupal\entity\DatabaseStorageController class, adding
|
||||
* This extends the Drupal\Core\Entity\DatabaseStorageController class, adding
|
||||
* required special handling for test entities.
|
||||
*/
|
||||
class EntityTestStorageController extends DatabaseStorageController {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::loadByProperties().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::loadByProperties().
|
||||
*/
|
||||
public function loadByProperties(array $values) {
|
||||
$query = db_select($this->entityInfo['base table'], 'base');
|
||||
|
@ -58,7 +58,7 @@ class EntityTestStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::attachLoad().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::attachLoad().
|
||||
*/
|
||||
protected function attachLoad(&$queried_entities, $load_revision = FALSE) {
|
||||
$data = db_select('entity_test_property_data', 'data', array('fetch' => PDO::FETCH_ASSOC))
|
||||
|
@ -82,7 +82,7 @@ class EntityTestStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::postSave().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::postSave().
|
||||
*/
|
||||
protected function postSave(EntityInterface $entity, $update) {
|
||||
$default_langcode = ($language = $entity->language()) ? $language->langcode : LANGUAGE_NOT_SPECIFIED;
|
||||
|
@ -107,7 +107,7 @@ class EntityTestStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::postDelete().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::postDelete().
|
||||
*/
|
||||
protected function postDelete($entities) {
|
||||
db_delete('entity_test_property_data')
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
namespace Drupal\taxonomy;
|
||||
|
||||
use Drupal\entity\ContentEntityInterface;
|
||||
use Drupal\entity\Entity;
|
||||
use Drupal\Core\Entity\ContentEntityInterface;
|
||||
use Drupal\Core\Entity\Entity;
|
||||
|
||||
/**
|
||||
* Defines the taxonomy term entity.
|
||||
|
@ -92,14 +92,14 @@ class Term extends Entity implements ContentEntityInterface {
|
|||
public $vocabulary_machine_name;
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityInterface::id().
|
||||
* Implements Drupal\Core\Entity\EntityInterface::id().
|
||||
*/
|
||||
public function id() {
|
||||
return $this->tid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityInterface::bundle().
|
||||
* Implements Drupal\Core\Entity\EntityInterface::bundle().
|
||||
*/
|
||||
public function bundle() {
|
||||
return $this->vocabulary_machine_name;
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
namespace Drupal\taxonomy;
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\entity\EntityFormController;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityFormController;
|
||||
|
||||
/**
|
||||
* Base for controller for taxonomy term edit forms.
|
||||
|
@ -16,7 +16,7 @@ use Drupal\entity\EntityFormController;
|
|||
class TermFormController extends EntityFormController {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::form().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::form().
|
||||
*/
|
||||
public function form(array $form, array &$form_state, EntityInterface $term) {
|
||||
$vocabulary = taxonomy_vocabulary_load($term->vid);
|
||||
|
@ -123,7 +123,7 @@ class TermFormController extends EntityFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::validate().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::validate().
|
||||
*/
|
||||
public function validate(array $form, array &$form_state) {
|
||||
parent::validate($form, $form_state);
|
||||
|
@ -135,7 +135,7 @@ class TermFormController extends EntityFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::submit().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::submit().
|
||||
*/
|
||||
public function submit(array $form, array &$form_state) {
|
||||
$term = parent::submit($form, $form_state);
|
||||
|
@ -152,7 +152,7 @@ class TermFormController extends EntityFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::save().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::save().
|
||||
*/
|
||||
public function save(array $form, array &$form_state) {
|
||||
$term = $this->getEntity($form_state);
|
||||
|
@ -196,7 +196,7 @@ class TermFormController extends EntityFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::delete().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::delete().
|
||||
*/
|
||||
public function delete(array $form, array &$form_state) {
|
||||
$destination = array();
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
namespace Drupal\taxonomy;
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\entity\DatabaseStorageController;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Entity\DatabaseStorageController;
|
||||
|
||||
/**
|
||||
* Defines a Controller class for taxonomy terms.
|
||||
|
@ -16,7 +16,7 @@ use Drupal\entity\DatabaseStorageController;
|
|||
class TermStorageController extends DatabaseStorageController {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::create().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::create().
|
||||
*
|
||||
* @param array $values
|
||||
* An array of values to set, keyed by property name. A value for the
|
||||
|
@ -41,7 +41,7 @@ class TermStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::buildQuery().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::buildQuery().
|
||||
*/
|
||||
protected function buildQuery($ids, $revision_id = FALSE) {
|
||||
$query = parent::buildQuery($ids, $revision_id);
|
||||
|
@ -55,9 +55,9 @@ class TermStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::buildPropertyQuery().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::buildPropertyQuery().
|
||||
*/
|
||||
protected function buildPropertyQuery(\Drupal\entity\EntityFieldQuery $entity_query, array $values) {
|
||||
protected function buildPropertyQuery(\Drupal\Core\Entity\EntityFieldQuery $entity_query, array $values) {
|
||||
if (isset($values['name'])) {
|
||||
$entity_query->propertyCondition('name', $values['name'], 'LIKE');
|
||||
unset($values['name']);
|
||||
|
@ -66,7 +66,7 @@ class TermStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::postDelete().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::postDelete().
|
||||
*/
|
||||
protected function postDelete($entities) {
|
||||
// See if any of the term's children are about to be become orphans.
|
||||
|
@ -97,7 +97,7 @@ class TermStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::postSave().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::postSave().
|
||||
*/
|
||||
protected function postSave(EntityInterface $entity, $update) {
|
||||
if (isset($entity->parent)) {
|
||||
|
@ -119,7 +119,7 @@ class TermStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::resetCache().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::resetCache().
|
||||
*/
|
||||
public function resetCache(array $ids = NULL) {
|
||||
drupal_static_reset('taxonomy_term_count_nodes');
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
namespace Drupal\taxonomy\Tests;
|
||||
|
||||
use Drupal\entity\EntityFieldQuery;
|
||||
use Drupal\Core\Entity\EntityFieldQuery;
|
||||
|
||||
/**
|
||||
* Tests the functionality of EntityFieldQuery for taxonomy entities.
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
namespace Drupal\taxonomy;
|
||||
|
||||
use Drupal\entity\Entity;
|
||||
use Drupal\Core\Entity\Entity;
|
||||
|
||||
/**
|
||||
* Defines the taxonomy vocabulary entity.
|
||||
|
@ -62,7 +62,7 @@ class Vocabulary extends Entity {
|
|||
public $weight = 0;
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityInterface::id().
|
||||
* Implements Drupal\Core\Entity\EntityInterface::id().
|
||||
*/
|
||||
public function id() {
|
||||
return $this->vid;
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
namespace Drupal\taxonomy;
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\entity\EntityFormController;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityFormController;
|
||||
|
||||
/**
|
||||
* Base form controller for vocabulary edit forms.
|
||||
|
@ -16,7 +16,7 @@ use Drupal\entity\EntityFormController;
|
|||
class VocabularyFormController extends EntityFormController {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::form().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::form().
|
||||
*/
|
||||
public function form(array $form, array &$form_state, EntityInterface $vocabulary) {
|
||||
|
||||
|
@ -80,7 +80,7 @@ class VocabularyFormController extends EntityFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::validate().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::validate().
|
||||
*/
|
||||
public function validate(array $form, array &$form_state) {
|
||||
parent::validate($form, $form_state);
|
||||
|
@ -100,7 +100,7 @@ class VocabularyFormController extends EntityFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::submit().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::submit().
|
||||
*/
|
||||
public function submit(array $form, array &$form_state) {
|
||||
// @todo We should not be calling taxonomy_vocabulary_confirm_delete() from
|
||||
|
@ -117,7 +117,7 @@ class VocabularyFormController extends EntityFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::save().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::save().
|
||||
*/
|
||||
public function save(array $form, array &$form_state) {
|
||||
$vocabulary = $this->getEntity($form_state);
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
namespace Drupal\taxonomy;
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\entity\DatabaseStorageController;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Entity\DatabaseStorageController;
|
||||
|
||||
/**
|
||||
* Defines a controller class for taxonomy vocabularies.
|
||||
|
@ -16,7 +16,7 @@ use Drupal\entity\DatabaseStorageController;
|
|||
class VocabularyStorageController extends DatabaseStorageController {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::buildQuery().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::buildQuery().
|
||||
*/
|
||||
protected function buildQuery($ids, $revision_id = FALSE) {
|
||||
$query = parent::buildQuery($ids, $revision_id);
|
||||
|
@ -27,7 +27,7 @@ class VocabularyStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::postSave().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::postSave().
|
||||
*/
|
||||
protected function postSave(EntityInterface $entity, $update) {
|
||||
if (!$update) {
|
||||
|
@ -39,7 +39,7 @@ class VocabularyStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::preDelete().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::preDelete().
|
||||
*/
|
||||
protected function preDelete($entities) {
|
||||
// Only load terms without a parent, child terms will get deleted too.
|
||||
|
@ -48,7 +48,7 @@ class VocabularyStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::postDelete().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::postDelete().
|
||||
*/
|
||||
protected function postDelete($entities) {
|
||||
// Load all Taxonomy module fields and delete those which use only this
|
||||
|
@ -79,7 +79,7 @@ class VocabularyStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DrupalDatabaseStorageController::resetCache().
|
||||
* Overrides Drupal\Core\Entity\DrupalDatabaseStorageController::resetCache().
|
||||
*/
|
||||
public function resetCache(array $ids = NULL) {
|
||||
drupal_static_reset('taxonomy_vocabulary_get_names');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
|
||||
/**
|
||||
* @file
|
||||
|
|
|
@ -4,5 +4,4 @@ package = Core
|
|||
version = VERSION
|
||||
core = 8.x
|
||||
dependencies[] = options
|
||||
dependencies[] = entity
|
||||
configure = admin/structure/taxonomy
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
use Drupal\node\Node;
|
||||
use Drupal\taxonomy\Term;
|
||||
use Drupal\taxonomy\Vocabulary;
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
|
||||
/**
|
||||
* Denotes that no term in the vocabulary has a parent.
|
||||
|
@ -1031,7 +1031,7 @@ function taxonomy_term_load_multiple_by_name($name, $vocabulary = NULL) {
|
|||
* database access if loaded again during the same page request.
|
||||
*
|
||||
* @see entity_load_multiple()
|
||||
* @see Drupal\entity\EntityFieldQuery
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery
|
||||
*
|
||||
* @param array $tids
|
||||
* (optional) An array of entity IDs. If omitted, all entities are loaded.
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
namespace Drupal\user;
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\entity\EntityFormController;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityFormController;
|
||||
|
||||
/**
|
||||
* Form controller for the user account forms.
|
||||
|
@ -16,7 +16,7 @@ use Drupal\entity\EntityFormController;
|
|||
abstract class AccountFormController extends EntityFormController {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::form().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::form().
|
||||
*/
|
||||
public function form(array $form, array &$form_state, EntityInterface $account) {
|
||||
global $user;
|
||||
|
@ -255,7 +255,7 @@ abstract class AccountFormController extends EntityFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::submit().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::submit().
|
||||
*/
|
||||
public function validate(array $form, array &$form_state) {
|
||||
parent::validate($form, $form_state);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
namespace Drupal\user;
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
|
||||
/**
|
||||
* Form controller for the profile forms.
|
||||
|
@ -15,7 +15,7 @@ use Drupal\entity\EntityInterface;
|
|||
class ProfileFormController extends AccountFormController {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::actions().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::actions().
|
||||
*/
|
||||
protected function actions(array $form, array &$form_state) {
|
||||
$element = parent::actions($form, $form_state);
|
||||
|
@ -36,7 +36,7 @@ class ProfileFormController extends AccountFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::submit().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::submit().
|
||||
*/
|
||||
public function submit(array $form, array &$form_state) {
|
||||
// @todo Consider moving this into the parent method.
|
||||
|
@ -46,7 +46,7 @@ class ProfileFormController extends AccountFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::save().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::save().
|
||||
*/
|
||||
public function save(array $form, array &$form_state) {
|
||||
$account = $this->getEntity($form_state);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
namespace Drupal\user;
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
|
||||
/**
|
||||
* Form controller for the user register forms.
|
||||
|
@ -15,7 +15,7 @@ use Drupal\entity\EntityInterface;
|
|||
class RegisterFormController extends AccountFormController {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::form().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::form().
|
||||
*/
|
||||
public function form(array $form, array &$form_state, EntityInterface $account) {
|
||||
global $user;
|
||||
|
@ -60,7 +60,7 @@ class RegisterFormController extends AccountFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::actions().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::actions().
|
||||
*/
|
||||
protected function actions(array $form, array &$form_state) {
|
||||
$element = parent::actions($form, $form_state);
|
||||
|
@ -69,7 +69,7 @@ class RegisterFormController extends AccountFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::submit().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::submit().
|
||||
*/
|
||||
public function submit(array $form, array &$form_state) {
|
||||
$admin = $form_state['values']['administer_users'];
|
||||
|
@ -91,7 +91,7 @@ class RegisterFormController extends AccountFormController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\EntityFormController::submit().
|
||||
* Overrides Drupal\Core\Entity\EntityFormController::submit().
|
||||
*/
|
||||
public function save(array $form, array &$form_state) {
|
||||
$account = $this->getEntity($form_state);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
namespace Drupal\user;
|
||||
|
||||
use Drupal\entity\Entity;
|
||||
use Drupal\Core\Entity\Entity;
|
||||
|
||||
/**
|
||||
* Defines the user entity class.
|
||||
|
@ -150,7 +150,7 @@ class User extends Entity {
|
|||
public $roles = array();
|
||||
|
||||
/**
|
||||
* Implements Drupal\entity\EntityInterface::id().
|
||||
* Implements Drupal\Core\Entity\EntityInterface::id().
|
||||
*/
|
||||
public function id() {
|
||||
return $this->uid;
|
||||
|
|
|
@ -7,20 +7,20 @@
|
|||
|
||||
namespace Drupal\user;
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\entity\EntityMalformedException;
|
||||
use Drupal\entity\DatabaseStorageController;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityMalformedException;
|
||||
use Drupal\Core\Entity\DatabaseStorageController;
|
||||
|
||||
/**
|
||||
* Controller class for users.
|
||||
*
|
||||
* This extends the Drupal\entity\DatabaseStorageController class, adding
|
||||
* This extends the Drupal\Core\Entity\DatabaseStorageController class, adding
|
||||
* required special handling for user objects.
|
||||
*/
|
||||
class UserStorageController extends DatabaseStorageController {
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::attachLoad().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::attachLoad().
|
||||
*/
|
||||
function attachLoad(&$queried_users, $load_revision = FALSE) {
|
||||
// Build an array of user picture IDs so that these can be fetched later.
|
||||
|
@ -60,7 +60,7 @@ class UserStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::create().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::create().
|
||||
*/
|
||||
public function create(array $values) {
|
||||
if (!isset($values['created'])) {
|
||||
|
@ -73,7 +73,7 @@ class UserStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::save().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::save().
|
||||
*/
|
||||
public function save(EntityInterface $entity) {
|
||||
if (empty($entity->uid)) {
|
||||
|
@ -84,7 +84,7 @@ class UserStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::preSave().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::preSave().
|
||||
*/
|
||||
protected function preSave(EntityInterface $entity) {
|
||||
// Update the user password if it has changed.
|
||||
|
@ -158,7 +158,7 @@ class UserStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::postSave().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::postSave().
|
||||
*/
|
||||
protected function postSave(EntityInterface $entity, $update) {
|
||||
|
||||
|
@ -223,7 +223,7 @@ class UserStorageController extends DatabaseStorageController {
|
|||
}
|
||||
|
||||
/**
|
||||
* Overrides Drupal\entity\DatabaseStorageController::postDelete().
|
||||
* Overrides Drupal\Core\Entity\DatabaseStorageController::postDelete().
|
||||
*/
|
||||
protected function postDelete($entities) {
|
||||
db_delete('users_roles')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
|
||||
/**
|
||||
* @file
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Drupal\Core\Database\Query\SelectInterface;
|
||||
use Drupal\entity\EntityInterface;
|
||||
use Drupal\Core\Entity\EntityInterface;
|
||||
use Drupal\file\File;
|
||||
use Drupal\Core\Template\Attribute;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
@ -289,7 +289,7 @@ function user_external_load($authname) {
|
|||
* @see user_load()
|
||||
* @see user_load_by_mail()
|
||||
* @see user_load_by_name()
|
||||
* @see Drupal\entity\EntityFieldQuery
|
||||
* @see Drupal\Core\Entity\EntityFieldQuery
|
||||
*/
|
||||
function user_load_multiple(array $uids = NULL, $reset = FALSE) {
|
||||
return entity_load_multiple('user', $uids, $reset);
|
||||
|
|
Loading…
Reference in New Issue