Skip to content

Commit 05f15db

Browse files
added helper methods and validators
1 parent 7e095ac commit 05f15db

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

src/Database/Document.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,14 @@ public function getCreatedAt(): ?string
164164
return $this->getAttribute('$createdAt');
165165
}
166166

167+
/**
168+
* @return string|null
169+
*/
170+
public function getCreatedBy(): ?string
171+
{
172+
return $this->getAttribute('$createdBy');
173+
}
174+
167175
/**
168176
* @return string|null
169177
*/
@@ -172,6 +180,14 @@ public function getUpdatedAt(): ?string
172180
return $this->getAttribute('$updatedAt');
173181
}
174182

183+
/**
184+
* @return string|null
185+
*/
186+
public function getUpdatedBy(): ?string
187+
{
188+
return $this->getAttribute('$updatedBy');
189+
}
190+
175191
/**
176192
* @return int|null
177193
*/

src/Database/Validator/Structure.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,29 @@ class Structure extends Validator
8484
'signed' => false,
8585
'array' => false,
8686
'filters' => [],
87-
]
87+
],
88+
[
89+
'$id' => '$createdBy',
90+
'type' => Database::VAR_STRING,
91+
'format' => '',
92+
'size' => 0,
93+
'signed' => false,
94+
'required' => false,
95+
'default' => null,
96+
'array' => false,
97+
'filters' => []
98+
],
99+
[
100+
'$id' => '$updatedBy',
101+
'type' => Database::VAR_STRING,
102+
'format' => '',
103+
'size' => 0,
104+
'signed' => false,
105+
'required' => false,
106+
'default' => null,
107+
'array' => false,
108+
'filters' => []
109+
],
88110
];
89111

90112
/**

0 commit comments

Comments
 (0)