. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Module; /** * Trait ModuleSidebarTrait - default implementation of ModuleSidebarInterface */ trait ModuleSidebarTrait { /** @var int The default position for this sidebar. It can be changed in the control panel. */ protected $sidebar_order = 0; /** * Users change change the order of sidebars using the control panel. * * @param int $sidebar_order * * @return void */ public function setSidebarOrder(int $sidebar_order): void { $this->sidebar_order = $sidebar_order; } /** * Users change change the order of sidebars using the control panel. * * @return int */ public function getSidebarOrder(): int { return $this->sidebar_order ?: $this->defaultSidebarOrder(); } /** * The default position for this sdiebar. * * @return int */ public function defaultSidebarOrder(): int { return 9999; } }