Insert new collection into database

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2018-10-29 11:18:38 +01:00
parent 702dcfb728
commit ab4b293854
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
1 changed files with 4 additions and 1 deletions

View File

@ -72,7 +72,10 @@ class Manager implements IManager {
*/
public function newCollection(string $name): ICollection {
$query = $this->connection->getQueryBuilder();
$query->insert('collres_collections');
$query->insert('collres_collections')
->values([
'name' => $query->createNamedParameter($name),
]);
$query->execute();
return new Collection($this, $this->connection, $query->getLastInsertId(), $name);