Lotsa bug fixes and updates

This commit is contained in:
Alex Bilbie
2014-07-11 18:27:03 +01:00
parent c6bc1b0cfc
commit 1e78f62823
17 changed files with 61 additions and 121 deletions

View File

@@ -19,10 +19,12 @@ trait EntityTrait
*/
public function hydrate(array $properties)
{
foreach ($properties as $prop) {
if (isset($this->{$prop})) {
$this->{$prop} = $prop;
foreach ($properties as $prop => $val) {
if (property_exists($this, $prop)) {
$this->{$prop} = $val;
}
}
return $this;
}
}