apigee_api_catalog-8.x-2.4/modules/apigee_graphql_doc/apigee_graphql_doc.install
modules/apigee_graphql_doc/apigee_graphql_doc.install
<?php
/**
* @file
* Copyright 2021 Google Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 2 as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/**
* @file
* Install, update, and uninstall functions for the Apigee GraphQL module.
*/
/**
* Implements hook_install().
*/
function apigee_graphql_doc_install($is_syncing) {
// Do not allow to delete the graphql_doc's node type machine name.
$locked = \Drupal::state()->get('node.type.locked');
$locked['graphql_doc'] = 'graphql_doc';
\Drupal::state()->set('node.type.locked', $locked);
}
/**
* Implements hook_uninstall().
*/
function apigee_graphql_doc_uninstall() {
// Allow to delete a graphql_doc's node type.
$locked = \Drupal::state()->get('node.type.locked');
unset($locked['graphql_doc']);
\Drupal::state()->set('node.type.locked', $locked);
}
