src/ORM/DatabaseAdmin.php
public function buildDefaults()
    {
        $dataClasses = ClassInfo::subclassesFor(DataObject::class);
        array_shift($dataClasses);

        if (!Director::is_cli()) {
            echo "<ul>";
        }

        foreach ($dataClasses as $dataClass) {
            singleton($dataClass)->requireDefaultRecords();
            if (Director::is_cli()) {
                echo "Defaults loaded for $dataClass\n";
            } else {
                echo "<li>Defaults loaded for $dataClass</li>\n";
            }
        }

        if (!Director::is_cli()) {
            echo "</ul>";
        }
    }
public function buildDefaults()
    {
        $dataClasses = ClassInfo::subclassesFor(DataObject::class);
        array_shift($dataClasses);

        if (!Director::is_cli()) {
            echo "<ul>";
        }

        foreach ($dataClasses as $dataClass) {
            singleton($dataClass)->requireDefaultRecords();
            if (Director::is_cli()) {
                echo "Defaults loaded for $dataClass\n";
            } else {
                echo "<li>Defaults loaded for $dataClass</li>\n";
            }
        }

        if (!Director::is_cli()) {
            echo "</ul>";
        }
    }
public function buildDefaults ( ) { $ dataClasses = ClassInfo :: subclassesFor ( DataObject :: class ) ; array_shift ( $ dataClasses ) ; if ( ! Director :: is_cli ( ) ) { echo "<ul>" ; } foreach ( $ dataClasses as $ dataClass ) { singleton ( $ dataClass ) -> requireDefaultRecords ( ) ; if ( Director :: is_cli ( ) ) { echo "Defaults loaded for $dataClass\n" ; } else { echo "<li>Defaults loaded for $dataClass</li>\n" ; } } if ( ! Director :: is_cli ( ) ) { echo "</ul>" ; } }
Build the default data, calling requireDefaultRecords on all
DataObject classes
Build the default data calling requireDefaultRecords on all DataObject classes