rvr-nextgen/database/migrations/data/20230507_0051_slug_for_communities.php

13 lines
365 B
PHP

<?php
use RVR\PersistentData\Model\Community;
use SokoWeb\Database\Query\Select;
$select = new Select(Container::$dbConnection);
$communities = Container::$persistentDataManager->selectMultipleFromDb($select, Community::class);
foreach ($communities as $community) {
$community->generateSlug();
Container::$persistentDataManager->saveToDb($community);
}