Change record status: 
Project: 
Introduced in branch: 
8.x
Introduced in version: 
8.0-ALPHA3
Description: 

As a part of #1802750: [Meta] Convert configurable data to ConfigEntity system

The {node_type} table is no longer installed on Drupal 8 and a new node_type config entity is used instead. The table is preserved in installations upgraded from earlier versions of Drupal to allow contrib modules to migrate their data.

The prefix is node.type., one example is shipped with book module in node.type.book.yml:

type: book
name: 'Book page'
description: '<em>Books</em> have a built-in hierarchical navigation. Use for handbooks or tutorials.'
help: ''
has_title: '1'
title_label: Title
settings:
  node:
    preview: '1'
    options:
      status: status
      # Not promoted to front page.
      promote: '0'
      sticky: '0'
      revision: '0'
    submitted: '1'
status: '1'
langcode: en

To disable deletion and renaming of this content type (also known as "locking") developers need to add the node type to a special key in the state subsystem called node.type.locked:

<?php
 
// Do not allow to delete the forum node type.
 
$locked = Drupal::state()->get('node.type.locked');
 
$locked['forum'] = 'forum';
 
Drupal::state()->set('node.type.locked', $locked);
?>

The following functions have changed:

  1. hook_node_type_insert()
  2. hook_node_type_update()
  3. hook_node_type_delete()

    these now have a \Drupal\node\NodeTypeInterface object as argument.

    hook_node_info() is removed in favour of config files.

    The node pseudo-hooks (like hook_load(), hook_delete(), hook_insert(), hook_prepare(), hook_update(), hook_validate(), hook_view()) and functions invoking them: node_hook() and node_invoke() are removed. Modules should move their implementations into the corresponding hook_node_*() hooks and use hook_form_alter*() to modify node forms.

Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done

Comments

I want to use this but don't know for example how to generate UUID for my content type.

I will add links if I find them but grateful for any pointers.

I've created some documentation, feel free to comment.

https://drupal.org/node/2087879

I worked it out in the end but your documentation would have saved me a bit of time, so I am sure it will help others.

Example lives in Examples For Developers project as node_type_example module. Browse the code here: http://drupalcode.org/project/examples.git/tree/refs/heads/8.x-1.x:/node...

  1. Install Drupal 8.
  2. Create a new content type at admin/structure/types/add. Let's call it 'Nifty Content Type'.
  3. Look in sites/default/files/config_[some hex codes]/active/. You'll see a file called node.type.nifty_content_type.yml.
  4. Copy or move that file to your module's config/ directory.
  5. You are done. Contemplate on how SUPER SCARY Drupal 8 is!!!!