Advertisement
Guest User

Untitled

a guest
May 6th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <?php
  2. abstract class BlockBase extends PluginBase implements BlockPluginInterface {
  3. /**
  4. * Returns generic default configuration for block plugins.
  5. *
  6. * @return array
  7. * An associative array with the default configuration.
  8. */
  9. protected function baseConfigurationDefaults() {
  10. return array(
  11. 'label' => '',
  12. 'module' => $this->pluginDefinition['module'],
  13. 'label_display' => BlockInterface::BLOCK_LABEL_VISIBLE,
  14. 'cache' => array(
  15. 'max_age' => 0,
  16. ),
  17. );
  18. }
  19. }
  20.  
  21. DRUPAL_NO_CACHE (equivalent: cache.max_age = 0)
  22. DRUPAL_CACHE_CUSTOM (equivalent: cache.max_age = 0 + Cache::keyFromQuery())
  23. DRUPAL_CACHE_PER_ROLE (equivalent: cache.max_age >0 + user.roles)
  24. DRUPAL_CACHE_PER_USER (equivalent: cache.max_age >0 + user)
  25. DRUPAL_CACHE_PER_PAGE (equivalent: cache.max_age >0 + url)
  26. DRUPAL_CACHE_GLOBAL (equivalent: cache.max_age >0, no cache contexts)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement