<?php

/**
 * @file
 * Install file for agov_scheduled_updates.
 */

use Drupal\Core\Entity\Entity\EntityFormDisplay;

/**
 * Implements hook_install().
 */
function agov_scheduled_updates_install() {
  if ($form_display = EntityFormDisplay::load('node.publication.default')) {
    $form_display->setComponent('publish_date', [
      'type' => 'inline_entity_form_complex',
      'weight' => 100,
      'settings' => [
        'override_labels' => TRUE,
        'label_singular' => 'scheduled publish date',
        'label_plural' => 'scheduled publish dates',
        'allow_new' => TRUE,
        'allow_existing' => FALSE,
        'match_operator' => 'CONTAINS',
      ],
      'third_party_settings' => [],
    ])->save();
  }
}
