You are here

function opigno_certificate_install in Opigno certificate 8

Same name and namespace in other branches
  1. 3.x opigno_certificate.install \opigno_certificate_install()

Creates default certificate.

Throws

\Drupal\Core\Entity\EntityStorageException

File

./opigno_certificate.install, line 18
Install, update and uninstall functions for the Opigno Certificate module.

Code

function opigno_certificate_install() {

  // Create default certificate.
  $certificate = OpignoCertificate::create([
    'bundle' => 'template',
    'label' => t('Default certificate'),
  ]);
  $certificate
    ->save();
}