diff --git a/core/modules/book/book.module b/core/modules/book/book.module index e530e6f..cee5ae0 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -6,7 +6,7 @@ */ use Drupal\Core\Entity\EntityInterface; -use Drupal\node\Plugin\Core\Entity\NodeType; +use Drupal\node\NodeTypeInterface; use Drupal\entity\Plugin\Core\Entity\EntityDisplay; use Drupal\Core\Template\Attribute; use Drupal\menu_link\Plugin\Core\Entity\MenuLink; @@ -1237,7 +1237,7 @@ function book_type_is_allowed($type) { * Updates book.settings configuration object if the machine-readable name of a * node type is changed. */ -function book_node_type_update(NodeType $type) { +function book_node_type_update(NodeTypeInterface $type) { if ($type->original->id() != $type->id()) { $config = config('book.settings'); // Update the list of node types that are allowed to be added to books. diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 0f306fd..c270945 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -9,7 +9,7 @@ * book page, etc. */ -use Drupal\node\Plugin\Core\Entity\NodeType; +use Drupal\node\NodeTypeInterface; use Drupal\entity\Plugin\Core\Entity\EntityDisplay; use Drupal\file\Plugin\Core\Entity\File; use Drupal\Core\Entity\EntityInterface; @@ -320,7 +320,7 @@ function comment_node_type_insert($info) { /** * Implements hook_node_type_update(). */ -function comment_node_type_update(NodeType $type) { +function comment_node_type_update(NodeTypeInterface $type) { if ($type->original->id() != $type->id()) { entity_invoke_bundle_hook('rename', 'comment', 'comment_node_' . $type->original->id(), 'comment_node_' . $type->id()); } diff --git a/core/modules/language/language.module b/core/modules/language/language.module index b92aafd..127b0de 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -5,7 +5,7 @@ * Add language handling functionality to Drupal. */ -use Drupal\node\Plugin\Core\Entity\NodeType; +use Drupal\node\NodeTypeInterface; /** * Implements hook_help(). @@ -424,7 +424,7 @@ function language_get_default_configuration_settings_key($entity_type, $bundle) /** * Implements hook_node_type_update(). */ -function language_node_type_update(NodeType $type) { +function language_node_type_update(NodeTypeInterface $type) { if ($type->original->id() != $type->id()) { language_save_default_configuration('node', $type->id(), language_get_default_configuration('node', $type->original->id())); language_clear_default_configuration('node', $type->original->id()); diff --git a/core/modules/node/content_types.inc b/core/modules/node/content_types.inc index 098a651..6716d81 100644 --- a/core/modules/node/content_types.inc +++ b/core/modules/node/content_types.inc @@ -5,7 +5,7 @@ * Content type editing user interface. */ -use Drupal\node\Plugin\Core\Entity\NodeType; +use Drupal\node\NodeTypeInterface; /** * Page callback: Displays the content type admin overview page. @@ -36,7 +36,7 @@ function node_type_add() { /** * Page callback: Presents the node type edit form. * - * @param \Drupal\node\Plugin\Core\Entity\NodeType $type + * @param \Drupal\node\NodeTypeInterface $type * The node type to edit. * * @return array @@ -44,7 +44,7 @@ function node_type_add() { * * @see node_menu() */ -function node_type_edit(NodeType $type) { +function node_type_edit(NodeTypeInterface $type) { drupal_set_title(t('Edit %label content type', array('%label' => $type->label())), PASS_THROUGH); return entity_get_form($type); } @@ -65,7 +65,7 @@ function _node_characters($length) { /** * Page callback: Form constructor for the content type delete form. * - * @param \Drupal\node\Plugin\Core\Entity\NodeType $type + * @param \Drupal\node\NodeTypeInterface $type * A node type entity. * * @return @@ -74,7 +74,7 @@ function _node_characters($length) { * @see node_type_delete_confirm_submit() * @ingroup forms */ -function node_type_delete_confirm($form, &$form_state, NodeType $type) { +function node_type_delete_confirm($form, &$form_state, NodeTypeInterface $type) { $form_state['entity'] = $type; $form['type'] = array('#type' => 'value', '#value' => $type->id()); diff --git a/core/modules/node/lib/Drupal/node/NodeTypeInterface.php b/core/modules/node/lib/Drupal/node/NodeTypeInterface.php new file mode 100644 index 0000000..e9da791 --- /dev/null +++ b/core/modules/node/lib/Drupal/node/NodeTypeInterface.php @@ -0,0 +1,29 @@ +settings[$module]) && is_array($this->settings[$module])) { diff --git a/core/modules/node/node.api.php b/core/modules/node/node.api.php index 4bc7875..d3832b1 100644 --- a/core/modules/node/node.api.php +++ b/core/modules/node/node.api.php @@ -1046,20 +1046,20 @@ function hook_ranking() { /** * Respond to node type creation. * - * @param \Drupal\node\Plugin\Core\Entity\NodeType $type + * @param \Drupal\node\NodeTypeInterface $type * The node type entity that was created. */ -function hook_node_type_insert(\Drupal\node\Plugin\Core\Entity\NodeType $type) { +function hook_node_type_insert(\Drupal\node\NodeTypeInterface $type) { drupal_set_message(t('You have just created a content type with a machine name %type.', array('%type' => $type->id()))); } /** * Respond to node type updates. * - * @param \Drupal\node\Plugin\Core\Entity\NodeType $type + * @param \Drupal\node\NodeTypeInterface $type * The node type entity that was updated. */ -function hook_node_type_update(\Drupal\node\Plugin\Core\Entity\NodeType $type) { +function hook_node_type_update(\Drupal\node\NodeTypeInterface $type) { if ($type->original->id() != $type->id()) { $setting = variable_get('comment_' . $type->original->id(), COMMENT_NODE_OPEN); variable_del('comment_' . $type->original->id()); @@ -1070,10 +1070,10 @@ function hook_node_type_update(\Drupal\node\Plugin\Core\Entity\NodeType $type) { /** * Respond to node type deletion. * - * @param \Drupal\node\Plugin\Core\Entity\NodeType $type + * @param \Drupal\node\NodeTypeInterface $type * The node type entity that was deleted. */ -function hook_node_type_delete(\Drupal\node\Plugin\Core\Entity\NodeType $type) { +function hook_node_type_delete(\Drupal\node\NodeTypeInterface $type) { variable_del('comment_' . $type->id()); } diff --git a/core/modules/node/node.module b/core/modules/node/node.module index ce30e81..4ee35ca 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -15,7 +15,7 @@ use Drupal\Core\Database\Query\SelectExtender; use Drupal\Core\Database\Query\SelectInterface; use Drupal\Core\Datetime\DrupalDateTime; -use Drupal\node\Plugin\Core\Entity\NodeType; +use Drupal\node\NodeTypeInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Template\Attribute; use Drupal\entity\Plugin\Core\Entity\EntityDisplay; @@ -409,13 +409,13 @@ function node_get_type_label(Entityinterface $node) { /** * Description callback: Returns the node type description. * - * @param \Drupal\node\Plugin\Core\Entity\NodeType $node_type + * @param \Drupal\node\NodeTypeInterface $node_type * The node type object. * * @return string * The node type description. */ -function node_type_get_description(NodeType $node_type) { +function node_type_get_description(NodeTypeInterface $node_type) { return $node_type->description; } @@ -434,7 +434,7 @@ function node_types_rebuild() { * @param $name * The machine name of a node type to load. * - * @return \Drupal\node\Plugin\Core\Entity\NodeType + * @return \Drupal\node\NodeTypeInterface * A node type object or FALSE if $name does not exist. */ function node_type_load($name) { @@ -444,7 +444,7 @@ function node_type_load($name) { /** * Adds the default body field to a node type. * - * @param \Drupal\node\Plugin\Core\Entity\NodeType $type + * @param \Drupal\node\NodeTypeInterface $type * A node type object. * @param $label * (optional) The label for the body instance. @@ -452,7 +452,7 @@ function node_type_load($name) { * @return * Body field instance. */ -function node_add_body_field(NodeType $type, $label = 'Body') { +function node_add_body_field(NodeTypeInterface $type, $label = 'Body') { // Add or remove the body field, as needed. $field = field_info_field('body'); $instance = field_info_instance('node', 'body', $type->id());