X7ROOT File Manager
Current Path:
/home/gfecatvj/sites/realesbar/platform/packages/widget/src
home
/
gfecatvj
/
sites
/
realesbar
/
platform
/
packages
/
widget
/
src
/
📁
..
📄
AbstractWidget.php
(3.99 KB)
📁
Contracts
📁
Facades
📁
Factories
📁
Http
📁
Misc
📁
Models
📁
Providers
📁
Repositories
📄
WidgetGroup.php
(5.53 KB)
📄
WidgetGroupCollection.php
(1.78 KB)
📄
WidgetId.php
(694 B)
📁
Widgets
Editing: WidgetGroupCollection.php
<?php namespace Botble\Widget; use Botble\Widget\Contracts\ApplicationWrapperContract; use Illuminate\Support\Arr; class WidgetGroupCollection { /** * The array of widget groups. * * @var array */ protected $groups; /** * @var ApplicationWrapperContract */ protected $app; /** * Constructor. * * @param ApplicationWrapperContract $app */ public function __construct(ApplicationWrapperContract $app) { $this->app = $app; } /** * Get the widget group object. * * @param string $sidebarId * @return WidgetGroup */ public function group($sidebarId) { if (isset($this->groups[$sidebarId])) { return $this->groups[$sidebarId]; } $this->groups[$sidebarId] = new WidgetGroup(['id' => $sidebarId, 'name' => $sidebarId], $this->app); return $this->groups[$sidebarId]; } /** * @param array $args * @return $this|mixed */ public function setGroup(array $args) { if (isset($this->groups[$args['id']])) { $group = $this->groups[$args['id']]; $group->setName(Arr::get($args, 'name')); $group->setDescription(Arr::get($args, 'description')); $this->groups[$args['id']] = $group; } else { $this->groups[$args['id']] = new WidgetGroup($args, $this->app); } return $this; } /** * @param string $groupId * @return $this */ public function removeGroup($groupId) { if (isset($this->groups[$groupId])) { unset($this->groups[$groupId]); } return $this; } /** * @return array */ public function getGroups() { return $this->groups; } }
Upload File
Create Folder