Guest User

Untitled

a guest
Jan 17th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1. function booze_entity_info() {
  2.   return array(
  3.     'booze_display' => array(
  4.       'label' => t('Display'),
  5.       'entity class' => 'Drupal\Core\Config\Entity\Display',
  6.       'controller class' => 'Drupal\Core\Config\Entity\ConfigStorageController',
  7.       'config prefix' => 'booze.display',
  8.       'fieldable' => FALSE,
  9.       'entity keys' => array(
  10.         'id' => 'id',
  11.         'label' => 'label', // @todo may not need this if internal-only (?)
  12.         'uuid' => 'uuid',
  13.       ),
  14.     )
  15.   );
  16. }
  17.  
  18. // and when i call this (when no such config item exists yet):
  19. $display = config('booze.display.foobar');
  20. // i get back an object of type Drupal\Core\Config\Config
Add Comment
Please, Sign In to add comment