<?php
|
namespace JVBase\managers\Dashboard;
|
|
if (!defined('ABSPATH')) {
|
exit;
|
}
|
|
class Section {
|
protected ?string $parent = null;
|
protected string $title;
|
protected string $slug;
|
protected string $icon = '';
|
protected int $order = 0;
|
protected bool $isLink = false;
|
|
public function __construct(string $title, ?string $slug = null, string $icon = '', ?string $parent = null) {
|
$this->title = $title;
|
$this->slug = is_null($slug) ? DashboardPage::sanitizeString($title) : DashboardPage::sanitizeString($slug);
|
$this->icon = $icon;
|
$this->parent = $parent;
|
}
|
|
public function getTitle():string
|
{
|
return $this->title;
|
}
|
public function getSlug():string
|
{
|
return $this->slug;
|
}
|
public function getIcon():string
|
{
|
return $this->icon;
|
}
|
public function getParent():?string
|
{
|
return $this->parent;
|
}
|
public function setOrder(int $order):void
|
{
|
$this->order = $order;
|
}
|
public function getOrder():int
|
{
|
return $this->order;
|
}
|
public function setIsLink(bool $isLink):void
|
{
|
$this->isLink = $isLink;
|
}
|
public function getIsLink():bool
|
{
|
return $this->isLink;
|
}
|
}
|