Skip to content

Commit eaea98f

Browse files
authored
Merge pull request #151 from fajnalowiec/master
pass validator to optionbs of document creation
2 parents a117d8e + 0ef975e commit eaea98f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Collection/Definition.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,15 @@ public function getExpressionClass()
172172

173173
public function getMongoCollectionOptions()
174174
{
175-
return array(
175+
$result = array(
176176
'capped' => $this->capped,
177177
'size' => $this->size,
178-
'max' => $this->max,
178+
'max' => $this->max,
179179
);
180+
if (isset($this->options['validator'])) {
181+
$result['validator'] = $this->options['validator'];
182+
}
183+
return $result;
180184
}
181185

182186
public function getOptions()

0 commit comments

Comments
 (0)