oliverdavies.uk-drupal-old/web/modules/custom/talks/opdavies_talks.install

23 lines
437 B
Plaintext
Raw Normal View History

2020-08-21 11:00:00 +00:00
<?php
2020-09-04 19:56:04 +00:00
/**
* @file
* Install, update and uninstall functions for opdavies_talks.
*/
2020-08-21 11:00:00 +00:00
declare(strict_types=1);
use Drupal\opdavies_talks\Repository\TalkRepository;
2020-08-21 11:00:00 +00:00
/**
* Set talk type for all existing talks.
*/
function opdavies_talks_update_8001(): void {
2020-08-21 11:00:00 +00:00
$talkRepository = \Drupal::service(TalkRepository::class);
foreach ($talkRepository->getAll() as $talk) {
$talk->set('field_type', 'talk');
$talk->save();
}
}