Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
manager.php
1<?php
2
3namespace Bitrix\UI\Toolbar;
4
6
7final class Manager
8{
10 private static $instance;
12 protected $toolbars = [];
13
14 private function __construct()
15 {}
16
17 private function __clone()
18 {}
19
24 public static function getInstance()
25 {
26 if (!isset(self::$instance))
27 {
28 self::$instance = new Manager;
29 }
30
31 return self::$instance;
32 }
33
39 public function getToolbarById($id)
40 {
41 if (isset($this->toolbars[$id]))
42 {
43 return $this->toolbars[$id];
44 }
45
46 return null;
47 }
48
49 public function createToolbar($id, $options)
50 {
51 if (empty($id))
52 {
53 throw new ArgumentException("id is required", 'id');
54 }
55
56 $toolbar = new Toolbar($id, $options);
57 $this->toolbars[$id] = $toolbar;
58
59 return $toolbar;
60 }
61}
createToolbar($id, $options)
Definition manager.php:49