diff --git a/config_entity_example/config/install/config_entity_example.robot.marvin.yml b/config_entity_example/config/install/config_entity_example.robot.marvin.yml index eceaf86..d5e0430 100644 --- a/config_entity_example/config/install/config_entity_example.robot.marvin.yml +++ b/config_entity_example/config/install/config_entity_example.robot.marvin.yml @@ -4,7 +4,10 @@ # config folder, which this original copy remains untouched. # For this system to work, we have to define our config schema in -# config/config_entity_example.robot.marvin.yml. +# config/install/config_entity_example.robot.marvin.yml. + +# You can see where these properties are defined in the annotation of +# Drupal\config_entity_example\Entity\Robot. # The id of the config entity. id: marvin diff --git a/config_entity_example/config_entity_example.module b/config_entity_example/config_entity_example.module index a1d67b5..a348ee1 100644 --- a/config_entity_example/config_entity_example.module +++ b/config_entity_example/config_entity_example.module @@ -53,21 +53,5 @@ function config_entity_example_permission() { } /** - * Implements hook_menu_link_defaults(). - * - * We'll just make a link to the list of robots. - * - * @return array - * An associative array representing the menu items for this module. - */ -function config_entity_example_menu_link_defaults() { - $links['config_entity_example_menu'] = array( - 'link_title' => 'Config Entity Example', - 'route_name' => 'robot.list', - ); - return $links; -} - -/** * @} End of "defgroup config_entity_example". */ diff --git a/config_entity_example/lib/Drupal/config_entity_example/Entity/Robot.php b/config_entity_example/lib/Drupal/config_entity_example/Entity/Robot.php index 8c614c8..eb34567 100644 --- a/config_entity_example/lib/Drupal/config_entity_example/Entity/Robot.php +++ b/config_entity_example/lib/Drupal/config_entity_example/Entity/Robot.php @@ -6,7 +6,7 @@ * * This contains our entity class. * - * credits: originally based on code from blog post at + * Originally based on code from blog post at * http://previousnext.com.au/blog/understanding-drupal-8s-config-entities */ @@ -17,8 +17,8 @@ use Drupal\Core\Config\Entity\ConfigEntityBase; /** * Defines the robot entity. * - * The lines below are a plugin annotation. These define the entity type to the - * entity type manager. + * The lines below, starting with '@ConfigEntityType,' are a plugin annotation. + * These define the entity type to the entity type manager. * * The properties in the annotation are as follows: * - id: The machine name of the entity type. @@ -26,15 +26,19 @@ use Drupal\Core\Config\Entity\ConfigEntityBase; * the "@Translation" wrapper so that the multilingual system may * translate it in the user interface. * - controllers: An array specifying controller classes that handle various - * aspects of the entity type's functionality. + * aspects of the entity type's functionality. Below, we've specified + * controllers which can list, add, edit, and delete our robot entity, and + * which control user access to these capabilities. * - config_prefix: This tells the config system the prefix to use for * filenames when storing entities. This means that the default entity we * include in our module has the filename * 'config_entity_example.robot.marvin.yml'. - * - entity_keys: Specifies the class variable(s) in which unique keys are - * stored for this entity type. - * + * - entity_keys: Specifies the class properties in which unique keys are + * stored for this entity type. Unique keys are properties which you know + * will be unique, and which the entity manager can use as unique in database + * queries. * + * @see http://previousnext.com.au/blog/understanding-drupal-8s-config-entities * @see annotation * @see Drupal\Core\Annotation\Translation *