-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
SDKgen-Bot
committed
Jun 8, 2024
1 parent
5e77ea7
commit aebd863
Showing
7 changed files
with
278 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace Fusio\Model\Backend; | ||
|
||
|
||
class DatabaseConnections implements \JsonSerializable, \PSX\Record\RecordableInterface | ||
{ | ||
/** | ||
* @var array<string>|null | ||
*/ | ||
protected ?array $connections = null; | ||
/** | ||
* @param array<string>|null $connections | ||
*/ | ||
public function setConnections(?array $connections) : void | ||
{ | ||
$this->connections = $connections; | ||
} | ||
/** | ||
* @return array<string>|null | ||
*/ | ||
public function getConnections() : ?array | ||
{ | ||
return $this->connections; | ||
} | ||
public function toRecord() : \PSX\Record\RecordInterface | ||
{ | ||
/** @var \PSX\Record\Record<mixed> $record */ | ||
$record = new \PSX\Record\Record(); | ||
$record->put('connections', $this->connections); | ||
return $record; | ||
} | ||
public function jsonSerialize() : object | ||
{ | ||
return (object) $this->toRecord()->getAll(); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace Fusio\Model\Backend; | ||
|
||
/** | ||
* @extends \PSX\Record\Record<mixed> | ||
*/ | ||
class DatabaseRow extends \PSX\Record\Record | ||
{ | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace Fusio\Model\Backend; | ||
|
||
/** | ||
* @extends \Fusio\Model\Common\Collection<DatabaseRow> | ||
*/ | ||
class DatabaseRows extends \Fusio\Model\Common\Collection | ||
{ | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace Fusio\Model\Backend; | ||
|
||
|
||
class DatabaseTable implements \JsonSerializable, \PSX\Record\RecordableInterface | ||
{ | ||
protected ?string $name = null; | ||
/** | ||
* @var array<DatabaseTableColumn>|null | ||
*/ | ||
protected ?array $columns = null; | ||
public function setName(?string $name) : void | ||
{ | ||
$this->name = $name; | ||
} | ||
public function getName() : ?string | ||
{ | ||
return $this->name; | ||
} | ||
/** | ||
* @param array<DatabaseTableColumn>|null $columns | ||
*/ | ||
public function setColumns(?array $columns) : void | ||
{ | ||
$this->columns = $columns; | ||
} | ||
/** | ||
* @return array<DatabaseTableColumn>|null | ||
*/ | ||
public function getColumns() : ?array | ||
{ | ||
return $this->columns; | ||
} | ||
public function toRecord() : \PSX\Record\RecordInterface | ||
{ | ||
/** @var \PSX\Record\Record<mixed> $record */ | ||
$record = new \PSX\Record\Record(); | ||
$record->put('name', $this->name); | ||
$record->put('columns', $this->columns); | ||
return $record; | ||
} | ||
public function jsonSerialize() : object | ||
{ | ||
return (object) $this->toRecord()->getAll(); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace Fusio\Model\Backend; | ||
|
||
|
||
class DatabaseTableColumn implements \JsonSerializable, \PSX\Record\RecordableInterface | ||
{ | ||
protected ?string $name = null; | ||
protected ?string $type = null; | ||
protected ?int $length = null; | ||
protected ?int $precision = null; | ||
protected ?int $scale = null; | ||
protected ?bool $unsigned = null; | ||
protected ?bool $fixed = null; | ||
protected ?bool $notNull = null; | ||
protected mixed $default = null; | ||
protected ?string $comment = null; | ||
public function setName(?string $name) : void | ||
{ | ||
$this->name = $name; | ||
} | ||
public function getName() : ?string | ||
{ | ||
return $this->name; | ||
} | ||
public function setType(?string $type) : void | ||
{ | ||
$this->type = $type; | ||
} | ||
public function getType() : ?string | ||
{ | ||
return $this->type; | ||
} | ||
public function setLength(?int $length) : void | ||
{ | ||
$this->length = $length; | ||
} | ||
public function getLength() : ?int | ||
{ | ||
return $this->length; | ||
} | ||
public function setPrecision(?int $precision) : void | ||
{ | ||
$this->precision = $precision; | ||
} | ||
public function getPrecision() : ?int | ||
{ | ||
return $this->precision; | ||
} | ||
public function setScale(?int $scale) : void | ||
{ | ||
$this->scale = $scale; | ||
} | ||
public function getScale() : ?int | ||
{ | ||
return $this->scale; | ||
} | ||
public function setUnsigned(?bool $unsigned) : void | ||
{ | ||
$this->unsigned = $unsigned; | ||
} | ||
public function getUnsigned() : ?bool | ||
{ | ||
return $this->unsigned; | ||
} | ||
public function setFixed(?bool $fixed) : void | ||
{ | ||
$this->fixed = $fixed; | ||
} | ||
public function getFixed() : ?bool | ||
{ | ||
return $this->fixed; | ||
} | ||
public function setNotNull(?bool $notNull) : void | ||
{ | ||
$this->notNull = $notNull; | ||
} | ||
public function getNotNull() : ?bool | ||
{ | ||
return $this->notNull; | ||
} | ||
public function setDefault(mixed $default) : void | ||
{ | ||
$this->default = $default; | ||
} | ||
public function getDefault() : mixed | ||
{ | ||
return $this->default; | ||
} | ||
public function setComment(?string $comment) : void | ||
{ | ||
$this->comment = $comment; | ||
} | ||
public function getComment() : ?string | ||
{ | ||
return $this->comment; | ||
} | ||
public function toRecord() : \PSX\Record\RecordInterface | ||
{ | ||
/** @var \PSX\Record\Record<mixed> $record */ | ||
$record = new \PSX\Record\Record(); | ||
$record->put('name', $this->name); | ||
$record->put('type', $this->type); | ||
$record->put('length', $this->length); | ||
$record->put('precision', $this->precision); | ||
$record->put('scale', $this->scale); | ||
$record->put('unsigned', $this->unsigned); | ||
$record->put('fixed', $this->fixed); | ||
$record->put('notNull', $this->notNull); | ||
$record->put('default', $this->default); | ||
$record->put('comment', $this->comment); | ||
return $record; | ||
} | ||
public function jsonSerialize() : object | ||
{ | ||
return (object) $this->toRecord()->getAll(); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace Fusio\Model\Backend; | ||
|
||
|
||
class DatabaseTables implements \JsonSerializable, \PSX\Record\RecordableInterface | ||
{ | ||
/** | ||
* @var array<string>|null | ||
*/ | ||
protected ?array $tables = null; | ||
/** | ||
* @param array<string>|null $tables | ||
*/ | ||
public function setTables(?array $tables) : void | ||
{ | ||
$this->tables = $tables; | ||
} | ||
/** | ||
* @return array<string>|null | ||
*/ | ||
public function getTables() : ?array | ||
{ | ||
return $this->tables; | ||
} | ||
public function toRecord() : \PSX\Record\RecordInterface | ||
{ | ||
/** @var \PSX\Record\Record<mixed> $record */ | ||
$record = new \PSX\Record\Record(); | ||
$record->put('tables', $this->tables); | ||
return $record; | ||
} | ||
public function jsonSerialize() : object | ||
{ | ||
return (object) $this->toRecord()->getAll(); | ||
} | ||
} | ||
|