Skip to content

Commit

Permalink
Add null to enum values if a Select is nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo St-Onge committed Feb 5, 2018
1 parent 1a30458 commit ff5e7f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Folklore/Panneau/Schemas/Fields/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ public function setOptions($value)

protected function enum()
{
$options = $this->getOptions();
$enum = [];
$nullable = $this->getNullable();
if ($nullable) {
$enum[] = null;
}
$options = $this->getOptions();
foreach ($options as $option) {
$enum[] = $option['value'];
}
Expand Down

0 comments on commit ff5e7f9

Please sign in to comment.