26 lines
669 B
HTML
26 lines
669 B
HTML
title = "SubTest"
|
|
layout = "default"
|
|
url = "/subtest"
|
|
==
|
|
<?php
|
|
function RandomString($len = 10) {
|
|
$characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
$randstring = '';
|
|
for ($i = 0; $i < $len; $i++) {
|
|
$randstring .= $characters[rand(0, strlen($characters) - 1)];
|
|
}
|
|
return $randstring;
|
|
}
|
|
function onStart() {
|
|
$ac = new GermanAirlinesVa\Fleet\Models\Aircraft();
|
|
$ac->aircraft_type_id = 1;
|
|
$ac->home_airport_id = 1;
|
|
$ac->registration = "D-".$this->RandomString(4);
|
|
$ac->name = $this->RandomString();
|
|
$ac->save();
|
|
|
|
\Nuwave\Lighthouse\Execution\Utils\Subscription::broadcast('aircraft', $ac);
|
|
}
|
|
?>
|
|
==
|