@@ -62,39 +62,39 @@ use Appwrite\\Models\\<%- toPascalCase(attribute.relatedCollection) %>;
62
62
< % if (attribute . format === ' enum' ) { -% >
63
63
enum < %- toPascalCase(attribute . key ) % > : string {
64
64
< % for (const [index , element ] of Object . entries(attribute . elements )) { -% >
65
- case < %- strict ? toUpperSnakeCase(element ) : element % > = ' <%- element %>' ;
65
+ case < %- strict ? toUpperSnakeCase(element ) : element % > = ' <%- element %>' ;
66
66
< % } -% >
67
67
}
68
68
69
69
< % } -% >
70
70
< % } -% >
71
71
class < %- toPascalCase(collection . name ) % > {
72
72
< % for (const attribute of collection . attributes ){ -% >
73
- private < %- getType (attribute ) % > $< %- strict ? toCamelCase(attribute . key ) : attribute . key % > ;
73
+ private < %- getType (attribute ) % > $< %- strict ? toCamelCase(attribute . key ) : attribute . key % > ;
74
74
< % } -% >
75
75
76
- public function __construct (
76
+ public function __construct (
77
77
<% for (const attribute of collection.attributes ){ -% >
78
78
< % if (attribute . required ) { -% >
79
- < %- getType (attribute ). replace(' |null' , ' ' ) % > $< %- strict ? toCamelCase(attribute . key ) : attribute . key % >< % if (collection . attributes . indexOf(attribute ) < collection . attributes . length - 1 ) { % > ,< % } % >
79
+ < %- getType (attribute ). replace(' |null' , ' ' ) % > $< %- strict ? toCamelCase(attribute . key ) : attribute . key % >< % if (collection . attributes . indexOf(attribute ) < collection . attributes . length - 1 ) { % > ,< % } % >
80
80
< % } else { -% >
81
- ?< %- getType (attribute ). replace(' |null' , ' ' ) % > $< %- strict ? toCamelCase(attribute . key ) : attribute . key % > = null < % if (collection . attributes . indexOf(attribute ) < collection . attributes . length - 1 ) { % > ,< % } % >
81
+ ?< %- getType (attribute ). replace(' |null' , ' ' ) % > $< %- strict ? toCamelCase(attribute . key ) : attribute . key % > = null < % if (collection . attributes . indexOf(attribute ) < collection . attributes . length - 1 ) { % > ,< % } % >
82
82
< % } -% >
83
83
< % } -% >
84
- ) {
84
+ ) {
85
85
< % for (const attribute of collection . attributes ){ -% >
86
- $this -> < %- strict ? toCamelCase(attribute . key ) : attribute . key % > = $< %- strict ? toCamelCase(attribute . key ) : attribute . key % > ;
86
+ $this -> < %- strict ? toCamelCase(attribute . key ) : attribute . key % > = $< %- strict ? toCamelCase(attribute . key ) : attribute . key % > ;
87
87
< % } -% >
88
- }
88
+ }
89
89
90
90
< % for (const [index , attribute ] of Object . entries(collection . attributes )) { -% >
91
- public function get < %- toPascalCase(attribute . key ) % > (): < %- getType (attribute ) % > {
92
- return $this -> < %- strict ? toCamelCase(attribute . key ) : attribute . key % > ;
93
- }
91
+ public function get < %- toPascalCase(attribute . key ) % > (): < %- getType (attribute ) % > {
92
+ return $this -> < %- strict ? toCamelCase(attribute . key ) : attribute . key % > ;
93
+ }
94
94
95
- public function set < %- toPascalCase(attribute . key ) % > (< %- getType (attribute ) % > $< %- strict ? toCamelCase(attribute . key ) : attribute . key % > ): void {
96
- $this -> < %- strict ? toCamelCase(attribute . key ) : attribute . key % > = $< %- strict ? toCamelCase(attribute . key ) : attribute . key % > ;
97
- }
95
+ public function set < %- toPascalCase(attribute . key ) % > (< %- getType (attribute ) % > $< %- strict ? toCamelCase(attribute . key ) : attribute . key % > ): void {
96
+ $this -> < %- strict ? toCamelCase(attribute . key ) : attribute . key % > = $< %- strict ? toCamelCase(attribute . key ) : attribute . key % > ;
97
+ }
98
98
< % if (index < collection . attributes . length - 1 ) { % >
99
99
< % } -% >
100
100
< % } -% >
0 commit comments