- Merged stash after pull

This commit is contained in:
mcndave committed 2020-10-16 15:27:54 +00:00
1 parent 114fa5be09
commit efa957fe58
20 files changed
+623 -436

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
<?php
namespace Ulmus\Query;
use Ulmus\Annotation,
Ulmus\Common\EntityField;
class Create extends Fragment {
const SQL_TOKEN = "CREATE TABLE";
public string $table;
public string $engine;
public int $order = -80;
public bool $skipExisting = true;
public array $fieldList;
public function render() : string
{
return $this->renderSegments([
static::SQL_TOKEN, $this->renderTables($this->table),
$this->renderFields(),
]);
}
public function renderFields() : string
{
return "(" . PHP_EOL . implode(",".PHP_EOL, array_map(function($field) {
return " ".EntityField::generateCreateColumn($field);
}, $this->fieldList)) . PHP_EOL . ")";
}
}