Commit f556c0b0 authored by catch's avatar catch

Issue #1760786 by sun: Move entity system 'back' into a Drupal\Core component.

parent f91e543a
......@@ -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 @@
/**
* 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 @@ public function __construct($entityType) {
}
/**
* Implements Drupal\entity\EntityStorageControllerInterface::resetCache().
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::resetCache().
*/
public function resetCache(array $ids = NULL) {
if (isset($ids)) {
......@@ -143,7 +143,7 @@ public function resetCache(array $ids = NULL) {
}
/**
* Implements Drupal\entity\EntityStorageControllerInterface::load().
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::load().
*/
public function load(array $ids = NULL) {
$entities = array();
......@@ -174,7 +174,7 @@ public function load(array $ids = NULL) {
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 @@ public function load(array $ids = NULL) {
}
/**
* 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 @@ public function loadRevision($revision_id) {
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 @@ public function loadRevision($revision_id) {
}
/**
* 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 @@ public function loadByProperties(array $values = array()) {
/**
* 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 @@ protected function cacheSet($entities) {
}
/**
* 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 @@ public function create(array $values) {
}
/**
* 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 @@ public function delete($ids) {
}
/**
* 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 @@ public function entityInfo() {
}
/**
* 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,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 @@ protected function init(array &$form_state, EntityInterface $entity) {
/**
* 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 @@ protected function actions(array $form, array &$form_state) {
}
/**
* 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 @@ public function validate(array $form, array &$form_state) {
}
/**
* 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 @@ public function delete(array $form, array &$form_state) {
}
/**
* 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 @@ public function getFormLangcode(array $form_state) {
}
/**
* 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 @@ public function buildEntity(array $form, array &$form_state) {
}
/**
* 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 @@ protected function prepareEntity(EntityInterface $entity) {
}
/**
* Implements Drupal\entity\EntityFormControllerInterface::getOperation().
* Implements Drupal\Core\Entity\EntityFormControllerInterface::getOperation().
*/