From 1106d7467611e438e0c97295c3ffe0fda70e5295 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 29 Aug 2021 10:55:43 +0200 Subject: [PATCH] add/change docs --- Models/NavElement.php | 101 +++++++++++++++++++++- tests/Controller/SearchControllerTest.php | 3 + 2 files changed, 102 insertions(+), 2 deletions(-) diff --git a/Models/NavElement.php b/Models/NavElement.php index 3064046..eec02c4 100755 --- a/Models/NavElement.php +++ b/Models/NavElement.php @@ -24,33 +24,130 @@ namespace Modules\Navigation\Models; */ class NavElement { + /** + * Id. + * + * @var int + * @since 1.0.0 + */ public int $id = 0; + /** + * Page Id. + * + * Generated from the path from a URI (sha1) + * + * @var string + * @since 1.0.0 + */ public string $pid = ''; + /** + * Name of the link. + * + * This "name" is a identifier for which is used in the language file for localization. + * + * @var string + * @since 1.0.0 + */ public string $name = ''; - public int $type = 1; + /** + * Link type. + * + * @var int + * @since 1.0.0 + */ + public int $type = LinkType::LINK; - public int $subtype = 2; + /** + * Navigation type (location of the link) + * + * @var int + * @since 1.0.0 + */ + public int $subtype = NavigationType::SIDE; + /** + * Icon string (css string for icon). + * + * @var null|string + * @since 1.0.0 + */ public ?string $icon = null; + /** + * Uri. + * + * @var null|string + * @since 1.0.0 + */ public ?string $uri = null; + /** + * Link target (target="self"). + * + * @var string + * @since 1.0.0 + */ public string $target = 'self'; + /** + * Action to perform on click. + * + * @var null|string + * @since 1.0.0 + */ public ?string $action = null; + /** + * Module identifier. + * + * @var string + * @since 1.0.0 + */ public string $from = '0'; + /** + * Order. + * + * @var int + * @since 1.0.0 + */ public int $order = 1; + /** + * Parent navigation element. + * + * @var int + * @since 1.0.0 + */ public int $parent = 0; + /** + * User permission required to show link (null = always/any). + * + * @var null|int + * @since 1.0.0 + */ public ?int $permissionPerm = null; + /** + * Permission type required to show link (null = any). + * + * Modules have different permission types (e.g. customer). + * The available types are defind in the respective module in \Modules\???\Models\PermissionState + * + * @var null|int + * @since 1.0.0 + */ public ?int $permissionType = null; + /** + * Element these permissions must be valid for (null = any). + * + * @var null|int + * @since 1.0.0 + */ public ?int $permissionElement = null; } diff --git a/tests/Controller/SearchControllerTest.php b/tests/Controller/SearchControllerTest.php index 9cdaaea..35e991f 100755 --- a/tests/Controller/SearchControllerTest.php +++ b/tests/Controller/SearchControllerTest.php @@ -47,6 +47,9 @@ class SearchControllerTest extends \PHPUnit\Framework\TestCase */ protected ModuleAbstract $module; + /** + * {@inheritdoc} + */ protected function setUp() : void { $this->app = new class() extends ApplicationAbstract