You are here

function answers_install in Answers 8

Same name and namespace in other branches
  1. 5.2 answers.install \answers_install()
  2. 7.4 answers.install \answers_install()

Implements hook_install().

File

./answers.install, line 13
Install, update, and uninstall functions for the Answers module.

Code

function answers_install() {

  // Do not allow the locked content type to be deleted.
  $locked = Drupal::state()
    ->get('node.type.locked');
  $locked['answers_question'] = 'answers_question';
  $locked['answers_answer'] = 'answers_answer';
  Drupal::state()
    ->set('node.type.locked', $locked);

  // \Drupal::entityTypeManager()
  // ->getStorage('answers_related_question')
  // ->load('node.answers_related_question')
  // ->setLocked(FALSE)
  // ->save();
}