class SettingsMenu extends Entity implements NodeInterface, JsonSerializable

관리메뉴를 표현하는 클래스

Properties

protected array $original The entity attribute's original state. from Entity
protected array $hidden The attributes that should be hidden for arrays. from Entity
protected array $fillable The attributes that are mass assignable. from Entity
protected array $guarded The attributes that aren't mass assignable. from Entity
bool $exists Indicates if the entity exists. from Entity
protected null|SettingsMenu $parent
protected SettingsMenu[] $childItems
protected bool $selected
protected int $depth
protected array $breadCrumbs
protected boolean $hasVisibleChild
Route $route

Methods

__construct(array $attributes = array())

Constructor

$this
syncOriginal()

Sync the original attributes with the current.

from Entity
array
getOriginal(string|null $key = null, mixed $default = null)

Get the entity's original attribute values.

from Entity
$this
fill(array $attributes)

Fill the model with an array of attributes.

from Entity
bool
isFillable(string $key)

Determine if the given attribute may be mass assigned.

from Entity
bool
isGuarded(string $key)

Determine if the given key is guarded.

from Entity
array
getDirty()

Get the attributes that have been changed since last sync.

from Entity
array
toArray()

Convert the entity instance to an array.

from Entity
Route|mixed|string
link()

메뉴의 링크를 생성하여 반환한다. 메뉴에 link정보가 있을 경우 link정보를 우선 사용하여 생성한다.

bool
hasVisibleChild()

메뉴의 자식 메뉴중 visible 상태인 메뉴가 있는지 조회한다.

getBreadCrumbs()

선택된 메뉴의 BreadCrumb을 반환한다.

void
resolveParentId(array $attributes)

tree구조를 생성하기 위해 관리메뉴의 부모메뉴 아이디를 찾아서 지정한다.

string|int
getNodeIdentifier()

Get the unique identifier for the node

string
getNodeIdentifierName()

Get the unique identifier name for the node

string|int
getParentNodeIdentifier()

Get the parent identifier for the node

void
setParent(NodeInterface $item)

Set parent node

mixed
getParent()

Return the parent node or null

void
addChild(NodeInterface $item)

Add child node

bool
hasChild()

Check having child and return the boolean result.

void
setChildren(NodeInterface[] $children = array())

Set child nodes

getChildren()

Return the child node items or empty array

string
getOrderKeyName()

Get the order key name for model

void
setSelected(bool $selected, bool $parentSelect = true)

setIsSelected

bool
isSelected()

isSelected

mixed
jsonSerialize()

(PHP 5 >= 5.4.0)
Specify data which should be serialized to JSON

Details

at line 73
__construct(array $attributes = array())

Constructor

Parameters

array $attributes 메뉴정보

in Entity at line 84
$this syncOriginal()

Sync the original attributes with the current.

Return Value

$this

in Entity at line 98
array getOriginal(string|null $key = null, mixed $default = null)

Get the entity's original attribute values.

Parameters

string|null $key key name
mixed $default default value when not exists

Return Value

array

in Entity at line 109
$this fill(array $attributes)

Fill the model with an array of attributes.

Parameters

array $attributes attributes

Return Value

$this

in Entity at line 126
bool isFillable(string $key)

Determine if the given attribute may be mass assigned.

Parameters

string $key key name

Return Value

bool

in Entity at line 145
bool isGuarded(string $key)

Determine if the given key is guarded.

Parameters

string $key key name

Return Value

bool

in Entity at line 155
array getDirty()

Get the attributes that have been changed since last sync.

Return Value

array

in Entity at line 165
array toArray()

Convert the entity instance to an array.

Return Value

array

메뉴의 링크를 생성하여 반환한다. 메뉴에 link정보가 있을 경우 link정보를 우선 사용하여 생성한다.

그 다음으로 메뉴에 연결된 route정보를 사용하여 링크를 생성한다.

Return Value

Route|mixed|string

Exceptions

Exception

at line 122
bool hasVisibleChild()

메뉴의 자식 메뉴중 visible 상태인 메뉴가 있는지 조회한다.

Return Value

bool

at line 147
SettingsMenu[] getBreadCrumbs()

선택된 메뉴의 BreadCrumb을 반환한다.

Return Value

SettingsMenu[]

at line 166
private void resolveParentId(array $attributes)

tree구조를 생성하기 위해 관리메뉴의 부모메뉴 아이디를 찾아서 지정한다.

Parameters

array $attributes 메뉴 정보

Return Value

void

at line 180
string|int getNodeIdentifier()

Get the unique identifier for the node

Return Value

string|int

at line 190
string getNodeIdentifierName()

Get the unique identifier name for the node

Return Value

string

at line 200
string|int getParentNodeIdentifier()

Get the parent identifier for the node

Return Value

string|int

at line 212
void setParent(NodeInterface $item)

Set parent node

Parameters

NodeInterface $item parent menu item

Return Value

void

at line 221
mixed getParent()

Return the parent node or null

Return Value

mixed

at line 232
void addChild(NodeInterface $item)

Add child node

Parameters

NodeInterface $item one child node - menu item

Return Value

void

at line 241
bool hasChild()

Check having child and return the boolean result.

Return Value

bool

at line 256
void setChildren(NodeInterface[] $children = array())

Set child nodes

Parameters

NodeInterface[] $children set array of menuItems

Return Value

void

at line 265
NodeInterface[] getChildren()

Return the child node items or empty array

Return Value

NodeInterface[]

at line 275
string getOrderKeyName()

Get the order key name for model

Return Value

string

at line 288
void setSelected(bool $selected, bool $parentSelect = true)

setIsSelected

Parameters

bool $selected menuItem selected flag
bool $parentSelect parent menuItem to selected flag

Return Value

void

at line 300
bool isSelected()

isSelected

Return Value

bool

at line 313
mixed jsonSerialize()

(PHP 5 >= 5.4.0)
Specify data which should be serialized to JSON

Return Value

mixed data which can be serialized by json_encode, which is a value of any type other than a resource.