1 | <?php |
||
17 | class JavascriptAsset extends BrowserAsset |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * @var boolean $load_in_footer |
||
22 | */ |
||
23 | private $load_in_footer = false; |
||
24 | |||
25 | /** |
||
26 | * @var boolean $requires_translation |
||
27 | */ |
||
28 | private $requires_translation = false; |
||
29 | |||
30 | /** |
||
31 | * @var boolean $has_localized_data |
||
32 | */ |
||
33 | private $has_localized_data = false; |
||
34 | |||
35 | /** |
||
36 | * @var Closure $localization_callback |
||
37 | */ |
||
38 | private $localization_callback; |
||
39 | |||
40 | |||
41 | /** |
||
42 | * Asset constructor. |
||
43 | * |
||
44 | * @param string $handle |
||
45 | * @param string $source |
||
46 | * @param array $dependencies |
||
47 | * @param bool $load_in_footer |
||
48 | * @param DomainInterface $domain |
||
49 | * @throws InvalidDataTypeException |
||
50 | */ |
||
51 | public function __construct( |
||
61 | |||
62 | |||
63 | /** |
||
64 | * @return bool |
||
65 | */ |
||
66 | public function loadInFooter() |
||
70 | |||
71 | |||
72 | /** |
||
73 | * @param bool $load_in_footer |
||
74 | */ |
||
75 | private function setLoadInFooter($load_in_footer = true) |
||
79 | |||
80 | |||
81 | /** |
||
82 | * @return bool |
||
83 | */ |
||
84 | public function requiresTranslation() |
||
88 | |||
89 | |||
90 | /** |
||
91 | * @param bool $requires_translation |
||
92 | * @return JavascriptAsset |
||
93 | */ |
||
94 | public function setRequiresTranslation($requires_translation = true) |
||
99 | |||
100 | |||
101 | /** |
||
102 | * @return bool |
||
103 | */ |
||
104 | public function hasLocalizedData() |
||
108 | |||
109 | |||
110 | /** |
||
111 | * @param bool $has_localized_data |
||
112 | * @return JavascriptAsset |
||
113 | */ |
||
114 | public function setHasLocalizedData($has_localized_data = true) |
||
119 | |||
120 | |||
121 | /** |
||
122 | * @return Closure |
||
123 | */ |
||
124 | public function localizationCallback() |
||
128 | |||
129 | |||
130 | /** |
||
131 | * @return bool |
||
132 | */ |
||
133 | public function hasLocalizationCallback() |
||
137 | |||
138 | |||
139 | /** |
||
140 | * @param Closure $localization_callback |
||
141 | * @return JavascriptAsset |
||
142 | */ |
||
143 | public function setLocalizationCallback(Closure $localization_callback) |
||
149 | |||
150 | |||
151 | /** |
||
152 | * @since $VID:$ |
||
153 | */ |
||
154 | public function enqueueAsset() |
||
158 | } |
||
159 |