AssetBundleRow
API reference › Debug Core › Panel › Asset › AssetBundleRow
Typed asset-bundle row narrowed once from the live AssetBundle and persisted in that form.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$basePath readonly constructor | string | Published base path, or '' when the bundle was never published. | AssetBundleRow |
$baseUrl readonly constructor | string | Published base URL, or '' when the bundle was never published. | AssetBundleRow |
$css readonly constructor | list<string> | CSS files declared by the bundle. | AssetBundleRow |
$depends readonly constructor | list<string> | Bundle class names this bundle depends on. | AssetBundleRow |
$js readonly constructor | list<string> | JavaScript files declared by the bundle. | AssetBundleRow |
$name readonly constructor | string | Bundle class name as registered on the asset manager. | AssetBundleRow |
$sourcePath readonly constructor | string | Source path declared by the bundle, or '' when it publishes nothing. | AssetBundleRow |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates an asset-bundle row from its captured metadata. | AssetBundleRow |
fromArray() static | Narrows one persisted bundle of the asset payload into a typed row. | AssetBundleRow |
fromBundle() static | Narrows one live asset bundle into a typed row. | AssetBundleRow |
jsonSerialize() | Returns the typed row for JSON serialization. | AssetBundleRow |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(string $name, string $sourcePath, string $basePath, string $baseUrl, array $css, array $js, array $depends)Creates an asset-bundle row from its captured metadata.
Parameters
| Parameter | Type | Description |
|---|---|---|
$name | string | |
$sourcePath | string | |
$basePath | string | |
$baseUrl | string | |
$css | array | |
$js | array | |
$depends | array |
fromArray()
Section titled “fromArray() ”public static function fromArray(mixed $data, string $path): selfNarrows one persisted bundle of the asset payload into a typed row.
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | mixed | Persisted bundle, expected to be an object carrying the declared shape. |
$path | string | JSON path of the bundle, used to report a malformed payload. |
Returns
self: Row carrying every persisted bundle field.
fromBundle()
Section titled “fromBundle() ”public static function fromBundle(string $name, array<array-key, mixed> $bundle): selfNarrows one live asset bundle into a typed row.
Parameters
| Parameter | Type | Description |
|---|---|---|
$name | string | |
$bundle | array<array-key, | Serialized bundle properties. |
Returns
self
jsonSerialize()
Section titled “jsonSerialize() ”public function jsonSerialize(): array<string, mixed>Returns the typed row for JSON serialization.
Returns
array<string, mixed>