diff options
Diffstat (limited to 'lib/public/Migration/Attributes/TableMigrationAttribute.php')
-rw-r--r-- | lib/public/Migration/Attributes/TableMigrationAttribute.php | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/lib/public/Migration/Attributes/TableMigrationAttribute.php b/lib/public/Migration/Attributes/TableMigrationAttribute.php index 1c3f90c6acf..571173b9ba1 100644 --- a/lib/public/Migration/Attributes/TableMigrationAttribute.php +++ b/lib/public/Migration/Attributes/TableMigrationAttribute.php @@ -10,9 +10,12 @@ namespace OCP\Migration\Attributes; use JsonSerializable; +/** + * @since 30.0.0 + */ class TableMigrationAttribute extends MigrationAttribute implements JsonSerializable { public function __construct( - string $table = '', + string $table, private array $columns = [], string $description = '', array $notes = [], @@ -20,21 +23,41 @@ class TableMigrationAttribute extends MigrationAttribute implements JsonSerializ parent::__construct($table, $description, $notes); } + /** + * @param array $columns + * + * @return $this + * @since 30.0.0 + */ public function setColumns(array $columns): self { $this->columns = $columns; return $this; } + /** + * @return array + * @since 30.0.0 + */ public function getColumns(): array { return $this->columns; } + /** + * @param array $data + * + * @return $this + * @since 30.0.0 + */ public function import(array $data): self { parent::import($data); $this->setColumns($data['columns'] ?? []); return $this; } + /** + * @return array + * @since 30.0.0 + */ public function jsonSerialize(): array { return array_merge( parent::jsonSerialize(), |