Skip to content

Commit

Permalink
ensure rows have all fields defined on init
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Feb 19, 2014
1 parent 9ca7f53 commit 167b355
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SimpleCrud/Row.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct (Entity $entity, array $data = null, $onlyDeclaredFi
$data = array_intersect_key($data, $this->entity->getFieldsNames());
}

$this->values = ($data === null) ? $entity->getDefaults() : $data;
$this->values = ($data ?: array()) + $entity->getDefaults();
}


Expand Down

0 comments on commit 167b355

Please sign in to comment.