-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OCA\Tables\Db; | ||
|
||
use OCP\AppFramework\Db\Entity; | ||
|
||
/** | ||
* @method getContextId(): int | ||
* @method setContextId(int $value): void | ||
* @method getNodeId(): int | ||
* @method setNodeId(int $value): void | ||
* @method getNodeType(): string | ||
* @method setNodeType(string $value): void | ||
* @method getPermissions(): int | ||
* @method setPermissions(int $value): void | ||
*/ | ||
|
||
class ContextNodeRelation extends Entity implements \JsonSerializable { | ||
protected ?int $contextId = null; | ||
protected ?int $nodeId = null; | ||
protected ?string $nodeType = null; | ||
protected ?int $permissions = null; | ||
|
||
public function __construct() { | ||
$this->addType('id', 'integer'); | ||
} | ||
|
||
public function jsonSerialize(): array { | ||
return [ | ||
'id' => $this->getId(), | ||
'contextId' => $this->getContextId(), | ||
'nodeId' => $this->getNodeId(), | ||
'nodeType' => $this->getNodeType(), | ||
'permissions' => $this->getPermissions() | ||
]; | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OCA\Tables\Db; | ||
|
||
use OCP\AppFramework\Db\QBMapper; | ||
use OCP\IDBConnection; | ||
|
||
class ContextNodeRelationMapper extends QBMapper { | ||
Check failure on line 10 in lib/Db/ContextNodeRelationMapper.php GitHub Actions / static-psalm-analysis dev-masterMissingTemplateParam
Check failure on line 10 in lib/Db/ContextNodeRelationMapper.php GitHub Actions / static-psalm-analysis dev-stable28MissingTemplateParam
|
||
protected string $table = 'tables_contexts_rel_context_node'; | ||
|
||
public function __construct(IDBConnection $db) { | ||
parent::__construct($db, $this->table, ContextNodeRelation::class); | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OCA\Tables\Db; | ||
|
||
use OCP\AppFramework\Db\Entity; | ||
|
||
/** | ||
* @method getContextId(): int | ||
* @method setContextId(int $value): void | ||
* @method getPageType(): string | ||
* @method setPageType(string $value): void | ||
*/ | ||
class Page extends Entity implements \JsonSerializable { | ||
public const TYPE_STARTPAGE = 'startpage'; | ||
|
||
protected ?int $contextId = null; | ||
protected ?string $pageType = null; | ||
|
||
public function __construct() { | ||
$this->addType('id', 'integer'); | ||
} | ||
|
||
public function jsonSerialize(): array { | ||
return [ | ||
'id' => $this->getId(), | ||
'contextId' => $this->getContextId(), | ||
'pageType' => $this->getPageType(), | ||
]; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OCA\Tables\Db; | ||
|
||
use OCP\AppFramework\Db\Entity; | ||
|
||
/** | ||
* @method getPageId(): int | ||
* @method setPageId(int $value): void | ||
* @method getNodeRelId(): int | ||
* @method setNodeRelId(int $value): void | ||
* @method getOrder(): int | ||
* @method setOrder(int $value): void | ||
*/ | ||
class PageContent extends Entity implements \JsonSerializable { | ||
protected ?int $pageId = null; | ||
protected ?int $nodeRelId = null; | ||
protected ?int $order = null; | ||
|
||
public function __construct() { | ||
$this->addType('id', 'integer'); | ||
} | ||
|
||
public function jsonSerialize(): array { | ||
return [ | ||
'id' => $this->getId(), | ||
'pageId' => $this->getPageId(), | ||
'nodeRelId' => $this->getNodeRelId(), | ||
'order' => $this->getOrder(), | ||
]; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace OCA\Tables\Db; | ||
|
||
use OCP\AppFramework\Db\QBMapper; | ||
use OCP\IDBConnection; | ||
|
||
class PageContentMapper extends QBMapper { | ||
Check failure on line 8 in lib/Db/PageContentMapper.php GitHub Actions / static-psalm-analysis dev-masterMissingTemplateParam
Check failure on line 8 in lib/Db/PageContentMapper.php GitHub Actions / static-psalm-analysis dev-stable28MissingTemplateParam
|
||
protected string $table = 'tables_contexts_page_content'; | ||
|
||
public function __construct(IDBConnection $db) { | ||
parent::__construct($db, $this->table, ContextNodeRelation::class); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace OCA\Tables\Db; | ||
|
||
use OCP\AppFramework\Db\QBMapper; | ||
use OCP\IDBConnection; | ||
|
||
class PageMapper extends QBMapper { | ||
Check failure on line 8 in lib/Db/PageMapper.php GitHub Actions / static-psalm-analysis dev-masterMissingTemplateParam
Check failure on line 8 in lib/Db/PageMapper.php GitHub Actions / static-psalm-analysis dev-stable28MissingTemplateParam
|
||
protected string $table = 'tables_contexts_page'; | ||
|
||
public function __construct(IDBConnection $db) { | ||
parent::__construct($db, $this->table, ContextNodeRelation::class); | ||
} | ||
} |