oliverdavies.uk-drupal-old/web/modules/custom/opdavies_talks/opdavies_talks.install
Oliver Davies 9b1a8fb3be Rename and re-organise custom modules
- Rename `opd_talks` to `opdavies_talks`
- Rename `custom` to `opdavies_blog`
2020-08-24 10:27:49 +01:00

18 lines
356 B
Plaintext

<?php
declare(strict_types=1);
use Drupal\opdavies_talks\Repository\TalkRepository;
/**
* Set talk type for all existing talks.
*/
function opdavies_talks_update_8001(): void {
$talkRepository = \Drupal::service(TalkRepository::class);
foreach ($talkRepository->getAll() as $talk) {
$talk->set('field_type', 'talk');
$talk->save();
}
}