Skip to content

Commit 7849e3a

Browse files
committed
Adding emptyAsset function to Asset class
To generate an empty asset component structure
1 parent 7d3aa97 commit 7849e3a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Data/Asset.php

+17
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,21 @@ public function updatedAt(): null|string
8888
{
8989
return $this->getFormattedDateTime('updated_at', "", format: "Y-m-d");
9090
}
91+
92+
public static function emptyAsset(): Asset
93+
{
94+
return self::make([
95+
"id" => null,
96+
"alt"=> null,
97+
"name"=> "",
98+
"focus"=> null,
99+
"title"=> null,
100+
"source"=> null,
101+
"filename"=> "",
102+
"copyright"=> null,
103+
"fieldtype"=> "asset",
104+
"meta_data"=> [],
105+
]);
106+
107+
}
91108
}

0 commit comments

Comments
 (0)